Skip to content

Commit

Permalink
Windows XP Fixes?
Browse files Browse the repository at this point in the history
Does this actually work?
  • Loading branch information
Azimer committed Aug 1, 2019
1 parent 5ac358a commit a972773
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/Project64-audio/Driver/SoundBase.cpp
Expand Up @@ -112,7 +112,7 @@ uint32_t SoundDriverBase::AI_ReadLength()

void SoundDriverBase::LoadAiBuffer(uint8_t *start, uint32_t length)
{
uint8_t nullBuff[MAX_SIZE];
static uint8_t nullBuff[MAX_SIZE];
uint8_t *ptrStart = start != NULL ? start : nullBuff;
uint32_t writePtr = 0, bytesToMove = length;

Expand Down
13 changes: 12 additions & 1 deletion Source/Project64/UserInterface/Debugger/ScriptInstance.cpp
Expand Up @@ -346,14 +346,25 @@ CScriptInstance::AddListener(HANDLE fd, IOEVENTTYPE evt, void* callback, void* d

void CScriptInstance::RemoveListenerByIndex(UINT index)
{
typedef BOOL (__stdcall *Dynamic_CancelIoEx)(HANDLE, LPOVERLAPPED);
Dynamic_CancelIoEx _CancelIoEx;
IOLISTENER* lpListener = m_Listeners[index];

if (lpListener->data != NULL)
{
free(lpListener->data);
}

CancelIoEx(lpListener->fd, (LPOVERLAPPED)lpListener);
HMODULE hKernel = LoadLibrary("Kernel32.dll");
_CancelIoEx = (Dynamic_CancelIoEx)GetProcAddress(hKernel, "CancelIoEx");

//CancelIoEx(lpListener->fd, (LPOVERLAPPED)lpListener);
if (_CancelIoEx != NULL)
_CancelIoEx(lpListener->fd, (LPOVERLAPPED)lpListener);
else
// This isn't a good replacement and the script aspects of the debugger shouldn't
// be used in WindowsXP
CancelIo(lpListener->fd);

free(lpListener);

Expand Down

0 comments on commit a972773

Please sign in to comment.