diff --git a/HookFilter/HookFilter.cpp b/HookFilter/HookFilter.cpp index fe3a045d..ebaf358c 100644 --- a/HookFilter/HookFilter.cpp +++ b/HookFilter/HookFilter.cpp @@ -12,7 +12,9 @@ extern "C" __declspec(dllexport) LRESULT CALLBACK LowLevelKeyboardProc( _In_ WPARAM wParam, _In_ LPARAM lParam) { +#ifndef _WIN64 #pragma comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__) +#endif if (nCode == HC_ACTION) { diff --git a/source/Configuration/About.cpp b/source/Configuration/About.cpp index 5dddcb39..62376fed 100644 --- a/source/Configuration/About.cpp +++ b/source/Configuration/About.cpp @@ -37,7 +37,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA."; -static BOOL CALLBACK DlgProcAbout(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +static INT_PTR CALLBACK DlgProcAbout(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { switch (message) { diff --git a/source/Configuration/IPropertySheetPage.h b/source/Configuration/IPropertySheetPage.h index 1b1e6d0c..4c927452 100644 --- a/source/Configuration/IPropertySheetPage.h +++ b/source/Configuration/IPropertySheetPage.h @@ -3,7 +3,7 @@ class IPropertySheetPage { protected: - virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) = 0; + virtual INT_PTR DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) = 0; virtual void DlgOK(HWND window) = 0; virtual void DlgCANCEL(HWND window) = 0; }; diff --git a/source/Configuration/PageAdvanced.cpp b/source/Configuration/PageAdvanced.cpp index 26e4e9e4..e70ae649 100644 --- a/source/Configuration/PageAdvanced.cpp +++ b/source/Configuration/PageAdvanced.cpp @@ -43,13 +43,13 @@ const TCHAR CPageAdvanced::m_CloneChoices[] = TEXT("Base 64A\0"); // Taiwanese -BOOL CALLBACK CPageAdvanced::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK CPageAdvanced::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { // Switch from static func to our instance return CPageAdvanced::ms_this->DlgProcInternal(hWnd, message, wparam, lparam); } -BOOL CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { switch (message) { @@ -65,11 +65,11 @@ BOOL CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR InitOptions(hWnd); break; case PSN_KILLACTIVE: - SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid break; case PSN_APPLY: DlgOK(hWnd); - SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid break; case PSN_QUERYCANCEL: // Can use this to ask user to confirm cancel diff --git a/source/Configuration/PageAdvanced.h b/source/Configuration/PageAdvanced.h index 7a348867..d40b0794 100644 --- a/source/Configuration/PageAdvanced.h +++ b/source/Configuration/PageAdvanced.h @@ -18,14 +18,14 @@ public: } virtual ~CPageAdvanced(){} - static BOOL CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); + static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); UINT GetTheFreezesF8Rom(void){ return m_uTheFreezesF8Rom; } void SetTheFreezesF8Rom(UINT uValue){ m_uTheFreezesF8Rom = uValue; } protected: // IPropertySheetPage - virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); + virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); virtual void DlgOK(HWND hWnd); virtual void DlgCANCEL(HWND hWnd){} diff --git a/source/Configuration/PageConfig.cpp b/source/Configuration/PageConfig.cpp index 1594dec0..8ff37e1b 100644 --- a/source/Configuration/PageConfig.cpp +++ b/source/Configuration/PageConfig.cpp @@ -44,13 +44,13 @@ const TCHAR CPageConfig::m_ComputerChoices[] = TEXT("Enhanced Apple //e\0") TEXT("Clone\0"); -BOOL CALLBACK CPageConfig::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK CPageConfig::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { // Switch from static func to our instance return CPageConfig::ms_this->DlgProcInternal(hWnd, message, wparam, lparam); } -BOOL CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { switch (message) { @@ -69,12 +69,12 @@ BOOL CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM // About to stop being active page { DWORD NewComputerMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0); - SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid } break; case PSN_APPLY: DlgOK(hWnd); - SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid break; case PSN_QUERYCANCEL: // Can use this to ask user to confirm cancel diff --git a/source/Configuration/PageConfig.h b/source/Configuration/PageConfig.h index e5d03daa..db4ea699 100644 --- a/source/Configuration/PageConfig.h +++ b/source/Configuration/PageConfig.h @@ -18,11 +18,11 @@ public: } virtual ~CPageConfig(){} - static BOOL CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); + static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); protected: // IPropertySheetPage - virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); + virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); virtual void DlgOK(HWND hWnd); virtual void DlgCANCEL(HWND hWnd){} diff --git a/source/Configuration/PageConfigTfe.cpp b/source/Configuration/PageConfigTfe.cpp index 2d4acaa4..f145efe5 100644 --- a/source/Configuration/PageConfigTfe.cpp +++ b/source/Configuration/PageConfigTfe.cpp @@ -57,13 +57,13 @@ uilib_dialog_group CPageConfigTfe::ms_rightgroup[] = {0, 0} }; -BOOL CALLBACK CPageConfigTfe::DlgProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK CPageConfigTfe::DlgProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { // Switch from static func to our instance return CPageConfigTfe::ms_this->DlgProcInternal(hwnd, msg, wparam, lparam); } -BOOL CPageConfigTfe::DlgProcInternal(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +INT_PTR CPageConfigTfe::DlgProcInternal(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) { diff --git a/source/Configuration/PageConfigTfe.h b/source/Configuration/PageConfigTfe.h index aafe846c..648afef4 100644 --- a/source/Configuration/PageConfigTfe.h +++ b/source/Configuration/PageConfigTfe.h @@ -12,11 +12,11 @@ public: } virtual ~CPageConfigTfe(){} - static BOOL CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam); + static INT_PTR CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam); protected: // IPropertySheetPage - virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam); + virtual INT_PTR DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam); virtual void DlgOK(HWND window); virtual void DlgCANCEL(HWND window); diff --git a/source/Configuration/PageDisk.cpp b/source/Configuration/PageDisk.cpp index 71e57e9f..92cbda58 100644 --- a/source/Configuration/PageDisk.cpp +++ b/source/Configuration/PageDisk.cpp @@ -46,13 +46,13 @@ const TCHAR CPageDisk::m_defaultHDDOptions[] = TEXT("Select Hard Disk Image...\0") TEXT("Unplug Hard Disk Image\0"); -BOOL CALLBACK CPageDisk::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK CPageDisk::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { // Switch from static func to our instance return CPageDisk::ms_this->DlgProcInternal(hWnd, message, wparam, lparam); } -BOOL CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { switch (message) { @@ -68,11 +68,11 @@ BOOL CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM l InitOptions(hWnd); break; case PSN_KILLACTIVE: - SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid break; case PSN_APPLY: DlgOK(hWnd); - SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid break; case PSN_QUERYCANCEL: // Can use this to ask user to confirm cancel diff --git a/source/Configuration/PageDisk.h b/source/Configuration/PageDisk.h index 16b8894c..cbf55db5 100644 --- a/source/Configuration/PageDisk.h +++ b/source/Configuration/PageDisk.h @@ -15,11 +15,11 @@ public: } virtual ~CPageDisk(){} - static BOOL CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); + static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); protected: // IPropertySheetPage - virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); + virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); virtual void DlgOK(HWND hWnd); virtual void DlgCANCEL(HWND hWnd){} diff --git a/source/Configuration/PageInput.cpp b/source/Configuration/PageInput.cpp index 15545279..84ffd6b0 100644 --- a/source/Configuration/PageInput.cpp +++ b/source/Configuration/PageInput.cpp @@ -64,13 +64,13 @@ const TCHAR CPageInput::m_szCPMSlotChoice_Unplugged[] = TEXT("Unplugged\0"); const TCHAR CPageInput::m_szCPMSlotChoice_Unavailable[] = TEXT("Unavailable\0"); -BOOL CALLBACK CPageInput::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK CPageInput::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { // Switch from static func to our instance return CPageInput::ms_this->DlgProcInternal(hWnd, message, wparam, lparam); } -BOOL CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { switch (message) { @@ -86,11 +86,11 @@ BOOL CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM InitOptions(hWnd); break; case PSN_KILLACTIVE: - SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid break; case PSN_APPLY: DlgOK(hWnd); - SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid break; case PSN_QUERYCANCEL: // Can use this to ask user to confirm cancel diff --git a/source/Configuration/PageInput.h b/source/Configuration/PageInput.h index da64840d..d527609b 100644 --- a/source/Configuration/PageInput.h +++ b/source/Configuration/PageInput.h @@ -25,7 +25,7 @@ public: } virtual ~CPageInput(){} - static BOOL CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam); + static INT_PTR CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam); UINT GetScrollLockToggle(void){ return m_uScrollLockToggle; } void SetScrollLockToggle(UINT uValue){ m_uScrollLockToggle = uValue; } @@ -44,7 +44,7 @@ public: protected: // IPropertySheetPage - virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); + virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); virtual void DlgOK(HWND hWnd); virtual void DlgCANCEL(HWND hWnd){} diff --git a/source/Configuration/PageSound.cpp b/source/Configuration/PageSound.cpp index d236afdf..1be8e722 100644 --- a/source/Configuration/PageSound.cpp +++ b/source/Configuration/PageSound.cpp @@ -40,13 +40,13 @@ const TCHAR CPageSound::m_soundchoices[] = TEXT("Disabled\0") TEXT("Sound Card\0"); -BOOL CALLBACK CPageSound::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK CPageSound::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { // Switch from static func to our instance return CPageSound::ms_this->DlgProcInternal(hWnd, message, wparam, lparam); } -BOOL CPageSound::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CPageSound::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { switch (message) { @@ -62,11 +62,11 @@ BOOL CPageSound::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM InitOptions(hWnd); break; case PSN_KILLACTIVE: - SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid break; case PSN_APPLY: DlgOK(hWnd); - SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid + SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid break; case PSN_QUERYCANCEL: // Can use this to ask user to confirm cancel diff --git a/source/Configuration/PageSound.h b/source/Configuration/PageSound.h index 9748d123..a1e9c6f7 100644 --- a/source/Configuration/PageSound.h +++ b/source/Configuration/PageSound.h @@ -19,13 +19,13 @@ public: } virtual ~CPageSound(){} - static BOOL CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); + static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); DWORD GetVolumeMax(void){ return VOLUME_MAX; } protected: // IPropertySheetPage - virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); + virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); virtual void DlgOK(HWND hWnd); virtual void DlgCANCEL(HWND hWnd){} diff --git a/source/Configuration/PropertySheet.cpp b/source/Configuration/PropertySheet.cpp index 8d8bed02..8f5a7ab1 100644 --- a/source/Configuration/PropertySheet.cpp +++ b/source/Configuration/PropertySheet.cpp @@ -43,31 +43,31 @@ void CPropertySheet::Init(void) PropSheetPages[PG_CONFIG].dwFlags = PSP_DEFAULT; PropSheetPages[PG_CONFIG].hInstance = GetFrame().g_hInstance; PropSheetPages[PG_CONFIG].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_CONFIG); - PropSheetPages[PG_CONFIG].pfnDlgProc = (DLGPROC)CPageConfig::DlgProc; + PropSheetPages[PG_CONFIG].pfnDlgProc = CPageConfig::DlgProc; PropSheetPages[PG_INPUT].dwSize = sizeof(PROPSHEETPAGE); PropSheetPages[PG_INPUT].dwFlags = PSP_DEFAULT; PropSheetPages[PG_INPUT].hInstance = GetFrame().g_hInstance; PropSheetPages[PG_INPUT].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_INPUT); - PropSheetPages[PG_INPUT].pfnDlgProc = (DLGPROC)CPageInput::DlgProc; + PropSheetPages[PG_INPUT].pfnDlgProc = CPageInput::DlgProc; PropSheetPages[PG_SOUND].dwSize = sizeof(PROPSHEETPAGE); PropSheetPages[PG_SOUND].dwFlags = PSP_DEFAULT; PropSheetPages[PG_SOUND].hInstance = GetFrame().g_hInstance; PropSheetPages[PG_SOUND].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_SOUND); - PropSheetPages[PG_SOUND].pfnDlgProc = (DLGPROC)CPageSound::DlgProc; + PropSheetPages[PG_SOUND].pfnDlgProc = CPageSound::DlgProc; PropSheetPages[PG_DISK].dwSize = sizeof(PROPSHEETPAGE); PropSheetPages[PG_DISK].dwFlags = PSP_DEFAULT; PropSheetPages[PG_DISK].hInstance = GetFrame().g_hInstance; PropSheetPages[PG_DISK].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_DISK); - PropSheetPages[PG_DISK].pfnDlgProc = (DLGPROC)CPageDisk::DlgProc; + PropSheetPages[PG_DISK].pfnDlgProc = CPageDisk::DlgProc; PropSheetPages[PG_ADVANCED].dwSize = sizeof(PROPSHEETPAGE); PropSheetPages[PG_ADVANCED].dwFlags = PSP_DEFAULT; PropSheetPages[PG_ADVANCED].hInstance = GetFrame().g_hInstance; PropSheetPages[PG_ADVANCED].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_ADVANCED); - PropSheetPages[PG_ADVANCED].pfnDlgProc = (DLGPROC)CPageAdvanced::DlgProc; + PropSheetPages[PG_ADVANCED].pfnDlgProc = CPageAdvanced::DlgProc; PROPSHEETHEADER PropSheetHeader; diff --git a/source/Tfe/Tfe.cpp b/source/Tfe/Tfe.cpp index 91f1705a..4da7117a 100644 --- a/source/Tfe/Tfe.cpp +++ b/source/Tfe/Tfe.cpp @@ -505,7 +505,7 @@ int tfe_activate_i(void) #ifdef TFE_DEBUG_INIT if(g_fh) fprintf(g_fh, "tfe_activate: Allocated memory successfully.\n"); - if(g_fh) fprintf(g_fh, "\ttfe at $%08X, tfe_packetpage at $%08X\n", uintptr_t(tfe), uintptr_t(tfe_packetpage) ); + if(g_fh) fprintf(g_fh, "\ttfe at $%08llX, tfe_packetpage at $%08llX\n", (unsigned long long)uintptr_t(tfe), (unsigned long long)uintptr_t(tfe_packetpage) ); #endif #ifdef DOS_TFE @@ -1361,7 +1361,7 @@ int set_tfe_enabled(void *v, void *param) { if (!tfe_cannot_use) { - if (!(int)v) { + if (!v) { /* TFE should be deactived */ if (tfe_enabled) { tfe_enabled = 0;