Merge pull request #1636 from Azimer/AziAudio-Reintegration
Windows XP Fixes
This commit is contained in:
commit
07033b4837
|
@ -112,7 +112,7 @@ uint32_t SoundDriverBase::AI_ReadLength()
|
||||||
|
|
||||||
void SoundDriverBase::LoadAiBuffer(uint8_t *start, uint32_t length)
|
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;
|
uint8_t *ptrStart = start != NULL ? start : nullBuff;
|
||||||
uint32_t writePtr = 0, bytesToMove = length;
|
uint32_t writePtr = 0, bytesToMove = length;
|
||||||
|
|
||||||
|
|
|
@ -346,6 +346,8 @@ CScriptInstance::AddListener(HANDLE fd, IOEVENTTYPE evt, void* callback, void* d
|
||||||
|
|
||||||
void CScriptInstance::RemoveListenerByIndex(UINT index)
|
void CScriptInstance::RemoveListenerByIndex(UINT index)
|
||||||
{
|
{
|
||||||
|
typedef BOOL (__stdcall *Dynamic_CancelIoEx)(HANDLE, LPOVERLAPPED);
|
||||||
|
Dynamic_CancelIoEx _CancelIoEx;
|
||||||
IOLISTENER* lpListener = m_Listeners[index];
|
IOLISTENER* lpListener = m_Listeners[index];
|
||||||
|
|
||||||
if (lpListener->data != NULL)
|
if (lpListener->data != NULL)
|
||||||
|
@ -353,7 +355,16 @@ void CScriptInstance::RemoveListenerByIndex(UINT index)
|
||||||
free(lpListener->data);
|
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);
|
free(lpListener);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue