1.22.1.2: extended logging for:

. WM_CREATE, WM_CLOSE + others
. DIMouse::DirectInputInit()
. MB_Initialize()
This commit is contained in:
tomch 2013-03-23 13:34:01 +00:00
parent 0732779eeb
commit 639f1e88e1
5 changed files with 91 additions and 24 deletions

View file

@ -253,8 +253,8 @@ DISK_ICON ICON "DISK.ICO"
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,22,1,1 FILEVERSION 1,22,1,2
PRODUCTVERSION 1,22,1,1 PRODUCTVERSION 1,22,1,2
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -272,12 +272,12 @@ BEGIN
VALUE "Comments", "http://applewin.berlios.de" VALUE "Comments", "http://applewin.berlios.de"
VALUE "CompanyName", "AppleWin" VALUE "CompanyName", "AppleWin"
VALUE "FileDescription", "Apple //e Emulator for Windows" VALUE "FileDescription", "Apple //e Emulator for Windows"
VALUE "FileVersion", "1, 22, 1, 1" VALUE "FileVersion", "1, 22, 1, 2"
VALUE "InternalName", "APPLEWIN" VALUE "InternalName", "APPLEWIN"
VALUE "LegalCopyright", " 1994-2013 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis" VALUE "LegalCopyright", " 1994-2013 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis"
VALUE "OriginalFilename", "APPLEWIN.EXE" VALUE "OriginalFilename", "APPLEWIN.EXE"
VALUE "ProductName", "Apple //e Emulator" VALUE "ProductName", "Apple //e Emulator"
VALUE "ProductVersion", "1, 22, 1, 1" VALUE "ProductVersion", "1, 22, 1, 2"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -955,8 +955,9 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
VideoInitialize(); // g_pFramebufferinfo been created now VideoInitialize(); // g_pFramebufferinfo been created now
LogFileOutput("Init: VideoInitialize()\n"); LogFileOutput("Init: VideoInitialize()\n");
LogFileOutput("Init: FrameCreateWindow() - pre\n");
FrameCreateWindow(); FrameCreateWindow();
LogFileOutput("Init: FrameCreateWindow()\n"); LogFileOutput("Init: FrameCreateWindow() - post\n");
// PrintScrn support // PrintScrn support
AppleWin_RegisterHotKeys(); // needs valid g_hFrameWindow AppleWin_RegisterHotKeys(); // needs valid g_hFrameWindow

View file

@ -706,6 +706,7 @@ LRESULT CALLBACK FrameWndProc (
break; break;
case WM_CLOSE: case WM_CLOSE:
LogFileOutput("WM_CLOSE\n");
if (g_bIsFullScreen) if (g_bIsFullScreen)
SetNormalMode(); SetNormalMode();
if (!IsIconic(window)) if (!IsIconic(window))
@ -718,6 +719,7 @@ LRESULT CALLBACK FrameWndProc (
helpquit = 0; helpquit = 0;
HtmlHelp(NULL,NULL,HH_CLOSE_ALL,0); HtmlHelp(NULL,NULL,HH_CLOSE_ALL,0);
} }
LogFileOutput("WM_CLOSE (done)\n");
break; break;
case WM_CHAR: case WM_CHAR:
@ -739,26 +741,44 @@ LRESULT CALLBACK FrameWndProc (
break; break;
case WM_CREATE: case WM_CREATE:
LogFileOutput("WM_CREATE\n");
g_hFrameWindow = window; g_hFrameWindow = window;
CreateGdiObjects(); CreateGdiObjects();
LogFileOutput("WM_CREATE: CreateGdiObjects()\n");
DSInit(); DSInit();
LogFileOutput("WM_CREATE: DSInit()\n");
DIMouse::DirectInputInit(window); DIMouse::DirectInputInit(window);
MB_Initialize(); LogFileOutput("WM_CREATE: DIMouse::DirectInputInit()\n");
SpkrInitialize();
DragAcceptFiles(window,1); MB_Initialize();
break; LogFileOutput("WM_CREATE: MB_Initialize()\n");
SpkrInitialize();
LogFileOutput("WM_CREATE: SpkrInitialize()\n");
DragAcceptFiles(window,1);
LogFileOutput("WM_CREATE: DragAcceptFiles()\n");
LogFileOutput("WM_CREATE (done)\n");
break;
case WM_DDE_INITIATE: { case WM_DDE_INITIATE: {
LogFileOutput("WM_DDE_INITIATE\n");
ATOM application = GlobalAddAtom(TEXT("applewin")); ATOM application = GlobalAddAtom(TEXT("applewin"));
ATOM topic = GlobalAddAtom(TEXT("system")); ATOM topic = GlobalAddAtom(TEXT("system"));
if(LOWORD(lparam) == application && HIWORD(lparam) == topic) if(LOWORD(lparam) == application && HIWORD(lparam) == topic)
SendMessage((HWND)wparam,WM_DDE_ACK,(WPARAM)window,MAKELPARAM(application,topic)); SendMessage((HWND)wparam,WM_DDE_ACK,(WPARAM)window,MAKELPARAM(application,topic));
GlobalDeleteAtom(application); GlobalDeleteAtom(application);
GlobalDeleteAtom(topic); GlobalDeleteAtom(topic);
LogFileOutput("WM_DDE_INITIATE (done)\n");
break; break;
} }
case WM_DDE_EXECUTE: { case WM_DDE_EXECUTE: {
LogFileOutput("WM_DDE_EXECUTE\n");
LPTSTR filename = (LPTSTR)GlobalLock((HGLOBAL)lparam); LPTSTR filename = (LPTSTR)GlobalLock((HGLOBAL)lparam);
//MessageBox( NULL, filename, "DDE Exec", MB_OK ); //MessageBox( NULL, filename, "DDE Exec", MB_OK );
ImageError_e Error = DiskInsert(DRIVE_1, filename, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE); ImageError_e Error = DiskInsert(DRIVE_1, filename, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
@ -774,10 +794,12 @@ LRESULT CALLBACK FrameWndProc (
DiskNotifyInvalidImage(DRIVE_1, filename, Error); DiskNotifyInvalidImage(DRIVE_1, filename, Error);
} }
GlobalUnlock((HGLOBAL)lparam); GlobalUnlock((HGLOBAL)lparam);
LogFileOutput("WM_DDE_EXECUTE (done)\n");
break; break;
} }
case WM_DESTROY: case WM_DESTROY:
LogFileOutput("WM_DESTROY\n");
DragAcceptFiles(window,0); DragAcceptFiles(window,0);
Snapshot_Shutdown(); Snapshot_Shutdown();
DebugDestroy(); DebugDestroy();
@ -796,6 +818,7 @@ LRESULT CALLBACK FrameWndProc (
DeleteGdiObjects(); DeleteGdiObjects();
DIMouse::DirectInputUninit(window); DIMouse::DirectInputUninit(window);
PostQuitMessage(0); // Post WM_QUIT message to the thread's message queue PostQuitMessage(0); // Post WM_QUIT message to the thread's message queue
LogFileOutput("WM_DESTROY (done)\n");
break; break;
case WM_DISPLAYCHANGE: case WM_DISPLAYCHANGE:

View file

@ -1086,6 +1086,7 @@ static void SSI263_Play(unsigned int nPhoneme)
static bool MB_DSInit() static bool MB_DSInit()
{ {
LogFileOutput("MB_DSInit\n", g_bMBAvailable);
#ifdef NO_DIRECT_X #ifdef NO_DIRECT_X
return false; return false;
@ -1103,13 +1104,16 @@ static bool MB_DSInit()
return false; return false;
HRESULT hr = DSGetSoundBuffer(&MockingboardVoice, DSBCAPS_CTRLVOLUME, g_dwDSBufferSize, SAMPLE_RATE, 2); HRESULT hr = DSGetSoundBuffer(&MockingboardVoice, DSBCAPS_CTRLVOLUME, g_dwDSBufferSize, SAMPLE_RATE, 2);
LogFileOutput("MB_DSInit: DSGetSoundBuffer(), hr=0x%08X\n", hr);
if(FAILED(hr)) if(FAILED(hr))
{ {
if(g_fh) fprintf(g_fh, "MB: DSGetSoundBuffer failed (%08X)\n",hr); if(g_fh) fprintf(g_fh, "MB: DSGetSoundBuffer failed (%08X)\n",hr);
return false; return false;
} }
if(!DSZeroVoiceBuffer(&MockingboardVoice, "MB", g_dwDSBufferSize)) bool bRes = DSZeroVoiceBuffer(&MockingboardVoice, "MB", g_dwDSBufferSize);
LogFileOutput("MB_DSInit: DSZeroVoiceBuffer(), res=%d\n", bRes ? 1 : 0);
if (!bRes)
return false; return false;
MockingboardVoice.bActive = true; MockingboardVoice.bActive = true;
@ -1118,7 +1122,8 @@ static bool MB_DSInit()
if(!MockingboardVoice.nVolume) if(!MockingboardVoice.nVolume)
MockingboardVoice.nVolume = DSBVOLUME_MAX; MockingboardVoice.nVolume = DSBVOLUME_MAX;
MockingboardVoice.lpDSBvoice->SetVolume(MockingboardVoice.nVolume); hr = MockingboardVoice.lpDSBvoice->SetVolume(MockingboardVoice.nVolume);
LogFileOutput("MB_DSInit: SetVolume(), hr=0x%08X\n", hr);
//--------------------------------- //---------------------------------
@ -1138,11 +1143,13 @@ static bool MB_DSInit()
FALSE, // bManualReset (FALSE = auto-reset) FALSE, // bManualReset (FALSE = auto-reset)
FALSE, // bInitialState (FALSE = non-signaled) FALSE, // bInitialState (FALSE = non-signaled)
NULL); // lpName NULL); // lpName
LogFileOutput("MB_DSInit: CreateEvent(), g_hSSI263Event[0]=0x%08X\n", (UINT32)g_hSSI263Event[0]);
g_hSSI263Event[1] = CreateEvent(NULL, // lpEventAttributes g_hSSI263Event[1] = CreateEvent(NULL, // lpEventAttributes
FALSE, // bManualReset (FALSE = auto-reset) FALSE, // bManualReset (FALSE = auto-reset)
FALSE, // bInitialState (FALSE = non-signaled) FALSE, // bInitialState (FALSE = non-signaled)
NULL); // lpName NULL); // lpName
LogFileOutput("MB_DSInit: CreateEvent(), g_hSSI263Event[1]=0x%08X\n", (UINT32)g_hSSI263Event[1]);
if((g_hSSI263Event[0] == NULL) || (g_hSSI263Event[1] == NULL)) if((g_hSSI263Event[0] == NULL) || (g_hSSI263Event[1] == NULL))
{ {
@ -1173,13 +1180,15 @@ static bool MB_DSInit()
// NB. DSBCAPS_LOCSOFTWARE required for Phoneme+2==0x28 - sample too short (see KB327698) // NB. DSBCAPS_LOCSOFTWARE required for Phoneme+2==0x28 - sample too short (see KB327698)
hr = DSGetSoundBuffer(&SSI263Voice[i], DSBCAPS_CTRLVOLUME+DSBCAPS_CTRLPOSITIONNOTIFY+DSBCAPS_LOCSOFTWARE, nPhonemeByteLength, 22050, 1); hr = DSGetSoundBuffer(&SSI263Voice[i], DSBCAPS_CTRLVOLUME+DSBCAPS_CTRLPOSITIONNOTIFY+DSBCAPS_LOCSOFTWARE, nPhonemeByteLength, 22050, 1);
LogFileOutput("MB_DSInit: (%02d) DSGetSoundBuffer(), hr=0x%08X\n", i, hr);
if(FAILED(hr)) if(FAILED(hr))
{ {
if(g_fh) fprintf(g_fh, "SSI263: DSGetSoundBuffer failed (%08X)\n",hr); if(g_fh) fprintf(g_fh, "SSI263: DSGetSoundBuffer failed (%08X)\n",hr);
return false; return false;
} }
hr = DSGetLock(SSI263Voice[i].lpDSBvoice, 0, 0, &pDSLockedBuffer, &dwDSLockedBufferSize, NULL, 0); bRes = DSGetLock(SSI263Voice[i].lpDSBvoice, 0, 0, &pDSLockedBuffer, &dwDSLockedBufferSize, NULL, 0);
LogFileOutput("MB_DSInit: (%02d) DSGetLock(), res=%d\n", i, bRes ? 1 : 0); // WARNING: Lock acquired && doing heavy-weight logging
if(FAILED(hr)) if(FAILED(hr))
{ {
if(g_fh) fprintf(g_fh, "SSI263: DSGetLock failed (%08X)\n",hr); if(g_fh) fprintf(g_fh, "SSI263: DSGetLock failed (%08X)\n",hr);
@ -1197,6 +1206,7 @@ static bool MB_DSInit()
} }
hr = SSI263Voice[i].lpDSBvoice->QueryInterface(IID_IDirectSoundNotify, (LPVOID *)&SSI263Voice[i].lpDSNotify); hr = SSI263Voice[i].lpDSBvoice->QueryInterface(IID_IDirectSoundNotify, (LPVOID *)&SSI263Voice[i].lpDSNotify);
LogFileOutput("MB_DSInit: (%02d) QueryInterface(), hr=0x%08X\n", i, hr); // WARNING: Lock acquired && doing heavy-weight logging
if(FAILED(hr)) if(FAILED(hr))
{ {
if(g_fh) fprintf(g_fh, "SSI263: QueryInterface failed (%08X)\n",hr); if(g_fh) fprintf(g_fh, "SSI263: QueryInterface failed (%08X)\n",hr);
@ -1210,6 +1220,7 @@ static bool MB_DSInit()
PositionNotify.hEventNotify = g_hSSI263Event[0]; PositionNotify.hEventNotify = g_hSSI263Event[0];
hr = SSI263Voice[i].lpDSNotify->SetNotificationPositions(1, &PositionNotify); hr = SSI263Voice[i].lpDSNotify->SetNotificationPositions(1, &PositionNotify);
LogFileOutput("MB_DSInit: (%02d) SetNotificationPositions(), hr=0x%08X\n", i, hr); // WARNING: Lock acquired && doing heavy-weight logging
if(FAILED(hr)) if(FAILED(hr))
{ {
if(g_fh) fprintf(g_fh, "SSI263: SetNotifyPos failed (%08X)\n",hr); if(g_fh) fprintf(g_fh, "SSI263: SetNotifyPos failed (%08X)\n",hr);
@ -1217,6 +1228,7 @@ static bool MB_DSInit()
} }
hr = SSI263Voice[i].lpDSBvoice->Unlock((void*)pDSLockedBuffer, dwDSLockedBufferSize, NULL, 0); hr = SSI263Voice[i].lpDSBvoice->Unlock((void*)pDSLockedBuffer, dwDSLockedBufferSize, NULL, 0);
LogFileOutput("MB_DSInit: (%02d) Unlock(),hr=0x%08X\n", i, hr);
if(FAILED(hr)) if(FAILED(hr))
{ {
if(g_fh) fprintf(g_fh, "SSI263: DSUnlock failed (%08X)\n",hr); if(g_fh) fprintf(g_fh, "SSI263: DSUnlock failed (%08X)\n",hr);
@ -1225,7 +1237,8 @@ static bool MB_DSInit()
SSI263Voice[i].bActive = false; SSI263Voice[i].bActive = false;
SSI263Voice[i].nVolume = MockingboardVoice.nVolume; // Use same volume as MB SSI263Voice[i].nVolume = MockingboardVoice.nVolume; // Use same volume as MB
SSI263Voice[i].lpDSBvoice->SetVolume(SSI263Voice[i].nVolume); hr = SSI263Voice[i].lpDSBvoice->SetVolume(SSI263Voice[i].nVolume);
LogFileOutput("MB_DSInit: (%02d) SetVolume(), hr=0x%08X\n", i, hr);
} }
// //
@ -1238,8 +1251,10 @@ static bool MB_DSInit()
NULL, // lpParameter NULL, // lpParameter
0, // dwCreationFlags : 0 = Run immediately 0, // dwCreationFlags : 0 = Run immediately
&dwThreadId); // lpThreadId &dwThreadId); // lpThreadId
LogFileOutput("MB_DSInit: CreateThread(), g_hThread=0x%08X\n", (UINT32)g_hThread);
SetThreadPriority(g_hThread, THREAD_PRIORITY_TIME_CRITICAL); BOOL bRes2 = SetThreadPriority(g_hThread, THREAD_PRIORITY_TIME_CRITICAL);
LogFileOutput("MB_DSInit: SetThreadPriority(), bRes=%d\n", bRes2 ? 1 : 0);
return true; return true;
@ -1317,6 +1332,7 @@ static void MB_DSUninit()
void MB_Initialize() void MB_Initialize()
{ {
LogFileOutput("MB_Initialize: g_bDisableDirectSound=%d, g_bDisableDirectSoundMockingboard=%d\n", g_bDisableDirectSound, g_bDisableDirectSoundMockingboard);
if (g_bDisableDirectSound || g_bDisableDirectSoundMockingboard) if (g_bDisableDirectSound || g_bDisableDirectSoundMockingboard)
{ {
MockingboardVoice.bMute = true; MockingboardVoice.bMute = true;
@ -1331,6 +1347,7 @@ void MB_Initialize()
ppAYVoiceBuffer[i] = new short [SAMPLE_RATE]; // Buffer can hold a max of 1 seconds worth of samples ppAYVoiceBuffer[i] = new short [SAMPLE_RATE]; // Buffer can hold a max of 1 seconds worth of samples
AY8910_InitAll((int)g_fCurrentCLK6502, SAMPLE_RATE); AY8910_InitAll((int)g_fCurrentCLK6502, SAMPLE_RATE);
LogFileOutput("MB_Initialize: AY8910_InitAll()\n");
for(i=0; i<NUM_AY8910; i++) for(i=0; i<NUM_AY8910; i++)
g_MB[i].nAY8910Number = i; g_MB[i].nAY8910Number = i;
@ -1338,8 +1355,10 @@ void MB_Initialize()
// //
g_bMBAvailable = MB_DSInit(); g_bMBAvailable = MB_DSInit();
LogFileOutput("MB_Initialize: MB_DSInit(), g_bMBAvailable=%d\n", g_bMBAvailable);
MB_Reset(); MB_Reset();
LogFileOutput("MB_Initialize: MB_Reset()\n");
} }
} }

View file

@ -608,6 +608,7 @@ namespace DIMouse
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
HRESULT DirectInputInit( HWND hDlg ) HRESULT DirectInputInit( HWND hDlg )
{ {
LogFileOutput("DirectInputInit\n");
#ifdef NO_DIRECT_X #ifdef NO_DIRECT_X
return E_FAIL; return E_FAIL;
@ -621,6 +622,7 @@ namespace DIMouse
DWORD dwCoopFlags; DWORD dwCoopFlags;
DirectInputUninit(hDlg); DirectInputUninit(hDlg);
LogFileOutput("DirectInputInit: DirectInputUninit()\n");
// Determine where the buffer would like to be allocated // Determine where the buffer would like to be allocated
bExclusive = FALSE; bExclusive = FALSE;
@ -638,12 +640,15 @@ namespace DIMouse
dwCoopFlags |= DISCL_BACKGROUND; dwCoopFlags |= DISCL_BACKGROUND;
// Create a DInput object // Create a DInput object
if( FAILED( hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION, hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&g_pDI, NULL );
IID_IDirectInput8, (VOID**)&g_pDI, NULL ) ) ) LogFileOutput("DirectInputInit: DirectInputUninit(), hr=0x%08X\n", hr);
if (FAILED(hr))
return hr; return hr;
// Obtain an interface to the system mouse device. // Obtain an interface to the system mouse device.
if( FAILED( hr = g_pDI->CreateDevice( GUID_SysMouse, &g_pMouse, NULL ) ) ) hr = g_pDI->CreateDevice( GUID_SysMouse, &g_pMouse, NULL );
LogFileOutput("DirectInputInit: CreateDevice(), hr=0x%08X\n", hr);
if (FAILED(hr))
return hr; return hr;
// Set the data format to "mouse format" - a predefined data format // Set the data format to "mouse format" - a predefined data format
@ -653,16 +658,20 @@ namespace DIMouse
// //
// This tells DirectInput that we will be passing a // This tells DirectInput that we will be passing a
// DIMOUSESTATE2 structure to IDirectInputDevice::GetDeviceState. // DIMOUSESTATE2 structure to IDirectInputDevice::GetDeviceState.
if( FAILED( hr = g_pMouse->SetDataFormat( &c_dfDIMouse2 ) ) ) hr = g_pMouse->SetDataFormat( &c_dfDIMouse2 );
LogFileOutput("DirectInputInit: SetDataFormat(), hr=0x%08X\n", hr);
if (FAILED(hr))
return hr; return hr;
// Set the cooperativity level to let DirectInput know how // Set the cooperativity level to let DirectInput know how
// this device should interact with the system and with other // this device should interact with the system and with other
// DirectInput applications. // DirectInput applications.
hr = g_pMouse->SetCooperativeLevel( hDlg, dwCoopFlags ); hr = g_pMouse->SetCooperativeLevel( hDlg, dwCoopFlags );
LogFileOutput("DirectInputInit: SetCooperativeLevel(), hr=0x%08X\n", hr);
if( hr == DIERR_UNSUPPORTED && !bForeground && bExclusive ) if( hr == DIERR_UNSUPPORTED && !bForeground && bExclusive )
{ {
DirectInputUninit(hDlg); DirectInputUninit(hDlg);
LogFileOutput("DirectInputInit: DirectInputUninit()n");
//MessageBox( hDlg, _T("SetCooperativeLevel() returned DIERR_UNSUPPORTED.\n") //MessageBox( hDlg, _T("SetCooperativeLevel() returned DIERR_UNSUPPORTED.\n")
// _T("For security reasons, background exclusive mouse\n") // _T("For security reasons, background exclusive mouse\n")
// _T("access is not allowed."), // _T("access is not allowed."),
@ -691,17 +700,23 @@ namespace DIMouse
dipdw.diph.dwHow = DIPH_DEVICE; dipdw.diph.dwHow = DIPH_DEVICE;
dipdw.dwData = SAMPLE_BUFFER_SIZE; // Arbitary buffer size dipdw.dwData = SAMPLE_BUFFER_SIZE; // Arbitary buffer size
if( FAILED( hr = g_pMouse->SetProperty( DIPROP_BUFFERSIZE, &dipdw.diph ) ) ) hr = g_pMouse->SetProperty( DIPROP_BUFFERSIZE, &dipdw.diph );
LogFileOutput("DirectInputInit: SetProperty(), hr=0x%08X\n", hr);
if (FAILED(hr))
return hr; return hr;
} }
// Acquire the newly created device // Acquire the newly created device
if (FAILED(hr = g_pMouse->Acquire())) hr = g_pMouse->Acquire();
LogFileOutput("DirectInputInit: Acquire(), hr=0x%08X\n", hr);
if (FAILED(hr))
return hr; return hr;
// Setup timer to read mouse position // Setup timer to read mouse position
if (g_TimerIDEvent = SetTimer(hDlg, IDEVENT_TIMER_MOUSE, 8, NULL) == 0) // 120Hz timer g_TimerIDEvent = SetTimer(hDlg, IDEVENT_TIMER_MOUSE, 8, NULL); // 120Hz timer
return -1; LogFileOutput("DirectInputInit: SetTimer(), id=0x%08X\n", g_TimerIDEvent);
if (g_TimerIDEvent == 0)
return E_FAIL;
return S_OK; return S_OK;
@ -714,17 +729,26 @@ namespace DIMouse
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void DirectInputUninit( HWND hDlg ) void DirectInputUninit( HWND hDlg )
{ {
LogFileOutput("DirectInputUninit\n");
// Unacquire the device one last time just in case // Unacquire the device one last time just in case
// the app tried to exit while the device is still acquired. // the app tried to exit while the device is still acquired.
if( g_pMouse ) if( g_pMouse )
g_pMouse->Unacquire(); {
HRESULT hr = g_pMouse->Unacquire();
LogFileOutput("DirectInputUninit: Unacquire(), hr=0x%08X\n", hr);
}
// Release any DirectInput objects. // Release any DirectInput objects.
SAFE_RELEASE( g_pMouse ); SAFE_RELEASE( g_pMouse );
SAFE_RELEASE( g_pDI ); SAFE_RELEASE( g_pDI );
if (g_TimerIDEvent) if (g_TimerIDEvent)
KillTimer(hDlg, g_TimerIDEvent); {
BOOL bRes = KillTimer(hDlg, g_TimerIDEvent);
LogFileOutput("DirectInputUninit: KillTimer(), res=%d\n", bRes ? 1 : 0);
g_TimerIDEvent = 0;
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------