Windows XP Fixes?

Does this actually work?
This commit is contained in:
Azimer 2019-07-31 23:15:26 -05:00
parent 5ac358a6ee
commit a972773b6a
2 changed files with 13 additions and 2 deletions

View File

@ -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;

View File

@ -346,6 +346,8 @@ 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)
@ -353,7 +355,16 @@ void CScriptInstance::RemoveListenerByIndex(UINT index)
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);