You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the official Fusion SDK, DWORDs are used for some return types/parameters in the CFile APIs, but DarkEdif mistakenly replaced them with declarations as unsigned ints instead, causing linking errors and some runtime issues with some CFile functions.
Do you have examples of this? I've used uint32_t as a replacement for DWORD in the past without issues. In theory unsigned int should be the same type as those always when targeting 32-bit Win32, but it is poor practice to use raw primitives.
Do you have examples of this? I've used uint32_t as a replacement for DWORD in the past without issues. In theory unsigned int should be the same type as those always when targeting 32-bit Win32, but it is poor practice to use raw primitives.
The linking errors were caused by these functions particularly:
FusionAPIImport unsigned int FusionAPI File_GetPosition(HFILE hf);
FusionAPIImport unsigned int FusionAPI File_SeekBegin(HFILE hf, long pos);
FusionAPIImport unsigned int FusionAPI File_SeekCurrent(HFILE hf, long pos);
FusionAPIImport unsigned int FusionAPI File_SeekEnd(HFILE hf, long pos);
DWORD (what these functions are actually defined to return, per official SDK docs) is defined to be an unsigned long rather than an unsigned int, which I believe is what was causing the linking errors because they aren't technically the same primitive types.
As for the runtime issues, I was trying to use the CInputBufFile::Read functions, but Visual Studio gave me an ESP run-time check failure after the function was called, and the function seemingly did nothing. This also had unsigned ints being declared rather than DWORDs, so changing them back to DWORDs solved this issue and the function was finally working.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the official Fusion SDK,
DWORDs are used for some return types/parameters in the CFile APIs, but DarkEdif mistakenly replaced them with declarations asunsigned ints instead, causing linking errors and some runtime issues with some CFile functions.