From: Toni Wilen Date: Sun, 19 Nov 2017 14:55:31 +0000 (+0200) Subject: Retroplatform update. X-Git-Tag: 3600~67 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=c5fb0ecea058e22c36526478059e4b878cd649e7;p=francis%2Fwinuae.git Retroplatform update. --- diff --git a/od-win32/cloanto/RetroPlatformGuestIPC.cpp b/od-win32/cloanto/RetroPlatformGuestIPC.cpp index 93159301..a99cb138 100644 --- a/od-win32/cloanto/RetroPlatformGuestIPC.cpp +++ b/od-win32/cloanto/RetroPlatformGuestIPC.cpp @@ -9,7 +9,7 @@ : Software Foundation. Authors : os, m Created : 2007-08-24 15:28:48 - Updated : 2017-01-04 06:15:00 + Updated : 2017-09-10 12:13:00 Comment : RetroPlatform Player interprocess communication functions (guest side) Note : Can be compiled both in Unicode and Multibyte projects *****************************************************************************/ @@ -19,23 +19,24 @@ // private functions static BOOL RegisterWndClass(LPCTSTR pszClassName, HINSTANCE hInstance); +static HMODULE LoadRPGuestDLL(HWND hHostMessageWindow); static LRESULT CALLBACK RPGuestWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); static const _TCHAR g_szHostWndClass[] = _T(RPIPC_HostWndClass); static const _TCHAR g_szGuestWndClass[] = _T(RPIPC_GuestWndClass); -static const WCHAR g_szRegistration[] = L"Cloanto(R) RetroPlatform(TM)"; +static const WCHAR g_szRegistration[] = L"Cloanto(R) RetroPlatform(TM) %d.%d"; /***************************************************************************** Name : RPInitializeGuest - Arguments : RPGUESTINFO *pInfo - structure receiving IPC context info - : HINSTANCE hInstance - current module instance - : LPCTSTR pszHostInfo - host information - : RPGUESTMSGFN pfnMsgFunction - message function to be called with incoming host messages - : LPARAM lMsgFunctionParam - application-defined value to be passed to the message function - Return : HRESULT - S_OK (successful initialization), S_FALSE (not started as guest), or error code + Arguments : RPGUESTINFO *pInfo - structure receiving IPC context info + : HINSTANCE hInstance - current module instance + : LPCTSTR pszHostInfo - host information + : PFN_MsgFunction pfnMsgFunction - message function to be called with incoming host messages + : LPARAM lMsgFunctionParam - application-defined value to be passed to the message function + Return : HRESULT - S_OK (successful initialization), S_FALSE (not started as guest), or error code Authors : os Created : 2007-08-24 16:45:32 Comment : the guest calls this function (typically at startup time) @@ -43,12 +44,16 @@ static const WCHAR g_szRegistration[] = L"Cloanto(R) RetroPlatform(TM)"; *****************************************************************************/ HRESULT RPInitializeGuest(RPGUESTINFO *pInfo, HINSTANCE hInstance, LPCTSTR pszHostInfo, - RPGUESTMSGFN pfnMsgFunction, LPARAM lMsgFunctionParam) + PFN_MsgFunction pfnMsgFunction, LPARAM lMsgFunctionParam) { _TCHAR szGuestClass[(sizeof(g_szGuestWndClass)/sizeof(_TCHAR))+20]; + WCHAR szRegistration[(sizeof(g_szRegistration)/sizeof(WCHAR))+10]; + PFN_RPGuestStartup pfnRPGuestStartup; + WORD wMajorVersion, wMinorVersion; _TCHAR *pszHostClass; - RAWINPUTDEVICE rid; LRESULT lr; + HRESULT hr; + int nLen; if (!pInfo || !pszHostInfo) return E_POINTER; @@ -59,6 +64,11 @@ HRESULT RPInitializeGuest(RPGUESTINFO *pInfo, HINSTANCE hInstance, LPCTSTR pszHo pInfo->bGuestClassRegistered = FALSE; pInfo->pfnMsgFunction = pfnMsgFunction; pInfo->lMsgFunctionParam = lMsgFunctionParam; + pInfo->hRPGuestDLL = NULL; + pInfo->pRPGuestDLLData = NULL; + pInfo->pfnRPProcessMessage = NULL; + pInfo->pfnRPSendMessage = NULL; + pInfo->pfnRPPostMessage = NULL; // find the host message window // @@ -95,7 +105,8 @@ HRESULT RPInitializeGuest(RPGUESTINFO *pInfo, HINSTANCE hInstance, LPCTSTR pszHo // register with the host // - if (!RPSendMessage(RP_IPC_TO_HOST_REGISTER, 0, 0, g_szRegistration, sizeof(g_szRegistration), pInfo, &lr)) + nLen = wsprintfW(szRegistration, g_szRegistration, RETROPLATFORM_API_VER_MAJOR, RETROPLATFORM_API_VER_MINOR); + if (!RPSendMessage(RP_IPC_TO_HOST_PRIVATE_REGISTER, 0, 0, szRegistration, (nLen + 1) * sizeof(WCHAR), pInfo, &lr)) { RPUninitializeGuest(pInfo); return HRESULT_FROM_WIN32(ERROR_HOST_UNREACHABLE); @@ -105,16 +116,83 @@ HRESULT RPInitializeGuest(RPGUESTINFO *pInfo, HINSTANCE hInstance, LPCTSTR pszHo RPUninitializeGuest(pInfo); return HRESULT_FROM_WIN32(ERROR_INVALID_ACCESS); } - // disable system shortcuts (e.g. Windows-key shortcuts) while the guest is the foreground app - rid.usUsagePage = 0x01; - rid.usUsage = 0x06; - rid.dwFlags = RIDEV_NOHOTKEYS; - rid.hwndTarget = 0; - RegisterRawInputDevices(&rid, 1, sizeof(rid)); + // load RPGuest.dll (or RPGuest64.dll) + // + pInfo->hRPGuestDLL = LoadRPGuestDLL(pInfo->hHostMessageWindow); + if (pInfo->hRPGuestDLL) + { + pfnRPGuestStartup = (PFN_RPGuestStartup)GetProcAddress(pInfo->hRPGuestDLL, "RPGuestStartup"); + hr = pfnRPGuestStartup ? pfnRPGuestStartup(pInfo, sizeof(RPGUESTINFO)) : E_NOTIMPL; + if (FAILED(hr)) + { + RPUninitializeGuest(pInfo); + return hr; + } + } + else + { + if (!RPSendMessage(RP_IPC_TO_HOST_HOSTAPIVERSION, 0, 0, NULL, 0, pInfo, &lr)) + lr = 0; + wMajorVersion = LOWORD(lr); + wMinorVersion = HIWORD(lr); + if (wMajorVersion > 7 || (wMajorVersion == 7 && wMinorVersion >= 2)) // RPGuest DLL required + { + RPUninitializeGuest(pInfo); + return HRESULT_FROM_WIN32(ERROR_DLL_NOT_FOUND); + } + } return S_OK; } +/***************************************************************************** + Name : LoadRPGuestDLL + Arguments : HWND hHostMessageWindow - + Return : static HMODULE - + Authors : os + Created : 2017-08-11 10:31:53 + Comment : + *****************************************************************************/ + +static HMODULE LoadRPGuestDLL(HWND hHostMessageWindow) +{ + typedef DWORD (WINAPI *PFN_GetModuleFileNameEx)(HANDLE hProcess, HMODULE hModule, LPTSTR lpFilename, DWORD nSize); + PFN_GetModuleFileNameEx pfnGetModuleFileNameEx; + DWORD dwHostProcessId; + HANDLE hHostProcess; + _TCHAR szPath[MAX_PATH]; + HINSTANCE hPsapi; + LPTSTR pszDLLName; + HMODULE hRPGuestDLL; + + hRPGuestDLL = NULL; + GetWindowThreadProcessId(hHostMessageWindow, &dwHostProcessId); + hHostProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwHostProcessId); + if (hHostProcess) + { + hPsapi = LoadLibrary(_T("psapi.dll")); + if (hPsapi) + { + pfnGetModuleFileNameEx = (PFN_GetModuleFileNameEx)GetProcAddress(hPsapi, (sizeof(_TCHAR) == 1) ? "GetModuleFileNameExA" : "GetModuleFileNameExW"); + if (pfnGetModuleFileNameEx) + { + if (pfnGetModuleFileNameEx(hHostProcess, (HMODULE)GetWindowLongPtr(hHostMessageWindow, GWLP_HINSTANCE), szPath, (sizeof(szPath)/sizeof(_TCHAR)))) + { + pszDLLName = _tcsrchr(szPath, '\\'); + if (pszDLLName) + { + _tcsncpy(pszDLLName + 1, (sizeof(void*) == 8) ? _T("RPGuest64.dll") : _T("RPGuest.dll"), (sizeof(szPath)/sizeof(_TCHAR)) - (pszDLLName - szPath) - 1); + hRPGuestDLL = LoadLibrary(szPath); + } + } + } + FreeLibrary(hPsapi); + } + CloseHandle(hHostProcess); + } + return hRPGuestDLL; +} + /***************************************************************************** Name : RPUninitializeGuest Arguments : RPGUESTINFO *pInfo - @@ -128,9 +206,8 @@ HRESULT RPInitializeGuest(RPGUESTINFO *pInfo, HINSTANCE hInstance, LPCTSTR pszHo void RPUninitializeGuest(RPGUESTINFO *pInfo) { - RAWINPUTDEVICE rid; - _TCHAR szGuestClass[(sizeof(g_szGuestWndClass)/sizeof(_TCHAR))+20]; + PFN_RPGuestShutdown pfnRPGuestShutdown; if (!pInfo) return; @@ -146,11 +223,14 @@ void RPUninitializeGuest(RPGUESTINFO *pInfo) UnregisterClass(szGuestClass, pInfo->hInstance); pInfo->bGuestClassRegistered = FALSE; } - rid.usUsagePage = 0x01; - rid.usUsage = 0x06; - rid.dwFlags = RIDEV_REMOVE | RIDEV_NOHOTKEYS; - rid.hwndTarget = 0; - RegisterRawInputDevices(&rid, 1, sizeof(rid)); + if (pInfo->hRPGuestDLL) + { + pfnRPGuestShutdown = (PFN_RPGuestShutdown)GetProcAddress(pInfo->hRPGuestDLL, "RPGuestShutdown"); + if (pfnRPGuestShutdown) + pfnRPGuestShutdown(pInfo, sizeof(RPGUESTINFO)); + FreeLibrary(pInfo->hRPGuestDLL); + pInfo->hRPGuestDLL = NULL; + } } /***************************************************************************** @@ -181,6 +261,11 @@ BOOL RPSendMessage(UINT uMessage, WPARAM wParam, LPARAM lParam, if (!pInfo->hHostMessageWindow) return FALSE; + if (pInfo->pfnRPSendMessage) + { + if (pInfo->pfnRPSendMessage(uMessage, wParam, lParam, pData, dwDataSize, pInfo, plResult)) + return TRUE; // message sent by RPGuest DLL + } if (pData) { COPYDATASTRUCT cds; @@ -224,6 +309,11 @@ BOOL RPPostMessage(UINT uMessage, WPARAM wParam, LPARAM lParam, const RPGUESTINF if (!pInfo->hHostMessageWindow) return FALSE; + if (pInfo->pfnRPPostMessage) + { + if (pInfo->pfnRPPostMessage(uMessage, wParam, lParam, pInfo)) + return TRUE; // message posted by RPGuest DLL + } return PostMessage(pInfo->hHostMessageWindow, uMessage, wParam, lParam); } @@ -272,32 +362,40 @@ static BOOL RegisterWndClass(LPCTSTR pszClassName, HINSTANCE hInstance) static LRESULT CALLBACK RPGuestWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam) { RPGUESTINFO *pInfo = (RPGUESTINFO *)(LONG_PTR)GetWindowLongPtr(hWnd, GWLP_USERDATA); - - if (uMessage == WM_CREATE) - { - LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam; - if (!lpcs) - return -1; - pInfo = (RPGUESTINFO *)lpcs->lpCreateParams; - if (!pInfo) - return -1; - #pragma warning (push) - #pragma warning (disable : 4244) // ignore LONG_PTR cast warning in 32-bit compilation - SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)pInfo); - #pragma warning (pop) - return 0; - } - else if (uMessage == WM_COPYDATA && pInfo && lParam) + if (pInfo) { - COPYDATASTRUCT *pcds = (COPYDATASTRUCT *)lParam; - return pInfo->pfnMsgFunction((UINT)pcds->dwData, 0, 0, pcds->lpData, pcds->cbData, pInfo->lMsgFunctionParam); + if (pInfo->pfnRPProcessMessage) + { + LRESULT lr; + if (pInfo->pfnRPProcessMessage(hWnd, uMessage, wParam, lParam, pInfo, &lr)) + return lr; // message fully processed by RPGuest DLL + } } - else if (uMessage >= WM_APP && uMessage <= 0xBFFF && pInfo) - { - return pInfo->pfnMsgFunction(uMessage, wParam, lParam, NULL, 0, pInfo->lMsgFunctionParam); - } - else + switch (uMessage) { - return DefWindowProc(hWnd, uMessage, wParam, lParam); + case WM_CREATE: + { + LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam; + if (!lpcs) + return -1; + pInfo = (RPGUESTINFO *)lpcs->lpCreateParams; + if (!pInfo) + return -1; + SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)pInfo); + return 0; + } + case WM_COPYDATA: + if (pInfo && lParam) + { + COPYDATASTRUCT *pcds = (COPYDATASTRUCT *)lParam; + if ((UINT)pcds->dwData >= WM_APP && (UINT)pcds->dwData <= 0xBFFF) + return pInfo->pfnMsgFunction((UINT)pcds->dwData, 0, 0, pcds->lpData, pcds->cbData, pInfo->lMsgFunctionParam); + } + break; + default: + if (pInfo && uMessage >= WM_APP && uMessage <= 0xBFFF) + return pInfo->pfnMsgFunction(uMessage, wParam, lParam, NULL, 0, pInfo->lMsgFunctionParam); + break; } + return DefWindowProc(hWnd, uMessage, wParam, lParam); } diff --git a/od-win32/cloanto/RetroPlatformGuestIPC.h b/od-win32/cloanto/RetroPlatformGuestIPC.h index 8b13eb93..ff5aafb9 100644 --- a/od-win32/cloanto/RetroPlatformGuestIPC.h +++ b/od-win32/cloanto/RetroPlatformGuestIPC.h @@ -9,7 +9,7 @@ : Software Foundation. Authors : os, m Created : 2007-08-24 15:29:26 - Updated : 2017-01-04 06:15:00 + Updated : 2017-09-10 12:13:00 Comment : RetroPlatform Player interprocess communication include file (guest side) *****************************************************************************/ @@ -19,7 +19,14 @@ #include #include -typedef LRESULT (CALLBACK *RPGUESTMSGFN)(UINT uMessage, WPARAM wParam, LPARAM lParam, LPCVOID pData, DWORD dwDataSize, LPARAM lMsgFunctionParam); +struct RPGuestInfo; +typedef LRESULT (CALLBACK *PFN_MsgFunction)(UINT uMessage, WPARAM wParam, LPARAM lParam, LPCVOID pData, DWORD dwDataSize, LPARAM lMsgFunctionParam); +// RPGuest.dll functions +typedef HRESULT (APIENTRY *PFN_RPGuestStartup)(struct RPGuestInfo *pInfo, DWORD cbInfo); +typedef HRESULT (APIENTRY *PFN_RPGuestShutdown)(struct RPGuestInfo *pInfo, DWORD cbInfo); +typedef BOOL (APIENTRY *PFN_RPProcessMessage)(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam, struct RPGuestInfo *pInfo, LRESULT *plResult); +typedef BOOL (APIENTRY *PFN_RPSendMessage)(UINT uMessage, WPARAM wParam, LPARAM lParam, LPCVOID pData, DWORD dwDataSize, const struct RPGuestInfo *pInfo, LRESULT *plResult); +typedef BOOL (APIENTRY *PFN_RPPostMessage)(UINT uMessage, WPARAM wParam, LPARAM lParam, const struct RPGuestInfo *pInfo); // the RPGuestInfo fields should be considered private, // since future implementations of RetroPlatform interprocess communication @@ -34,8 +41,13 @@ typedef struct RPGuestInfo HWND hHostMessageWindow; HWND hGuestMessageWindow; BOOL bGuestClassRegistered; - RPGUESTMSGFN pfnMsgFunction; + PFN_MsgFunction pfnMsgFunction; LPARAM lMsgFunctionParam; + HMODULE hRPGuestDLL; + LPVOID pRPGuestDLLData; + PFN_RPProcessMessage pfnRPProcessMessage; + PFN_RPSendMessage pfnRPSendMessage; + PFN_RPPostMessage pfnRPPostMessage; } RPGUESTINFO; #ifdef __cplusplus @@ -45,7 +57,7 @@ extern "C" { // RetroPlatform IPC public functions // (see instructions in RetroPlatformGuestIPC.c) // -HRESULT RPInitializeGuest(RPGUESTINFO *pInfo, HINSTANCE hInstance, LPCTSTR pszHostInfo, RPGUESTMSGFN pfnMsgFunction, LPARAM lMsgFunctionParam); +HRESULT RPInitializeGuest(RPGUESTINFO *pInfo, HINSTANCE hInstance, LPCTSTR pszHostInfo, PFN_MsgFunction pfnMsgFunction, LPARAM lMsgFunctionParam); void RPUninitializeGuest(RPGUESTINFO *pInfo); BOOL RPSendMessage(UINT uMessage, WPARAM wParam, LPARAM lParam, LPCVOID pData, DWORD dwDataSize, const RPGUESTINFO *pInfo, LRESULT *plResult); BOOL RPPostMessage(UINT uMessage, WPARAM wParam, LPARAM lParam, const RPGUESTINFO *pInfo); diff --git a/od-win32/cloanto/RetroPlatformIPC-doc.txt b/od-win32/cloanto/RetroPlatformIPC-doc.txt index f8e931c5..b6e0e027 100644 --- a/od-win32/cloanto/RetroPlatformIPC-doc.txt +++ b/od-win32/cloanto/RetroPlatformIPC-doc.txt @@ -9,7 +9,7 @@ : assigned or transferred by contract. Authors : os, m Created : 2007-08-23 10:08:25 - Updated : 2017-01-04 06:15:00 + Updated : 2017-09-10 12:13:00 Comment : Reference for RetroPlatformIPC.h (RP Player interprocess communication include file) *****************************************************************************/ @@ -498,6 +498,13 @@ Response: none +Messages: + RP_IPC_TO_HOST_PRIVATE_SHAREDEVENT + RP_IPC_TO_HOST_PRIVATE_TYPECLIPDONE + RP_IPC_TO_HOST_PRIVATE_KEYEVENT + RP_IPC_TO_HOST_PRIVATE_GUESTEVENT +Description: + these are private messages, sent by code in RPGuest.dll @@ -798,6 +805,18 @@ Description: Before opening the dialog, the guest should send RP_IPC_TO_HOST_PAUSE message to pause the emulation session. After closing the dialog, the emulation should be resumed by sending another RP_IPC_TO_HOST_PAUSE message. Data sent: - none + None Response: LRESULT = 1 if the guest acknowledged the command or 0 otherwise + + +Messages: + RP_IPC_TO_GUEST_PRIVATE_STARTUP + RP_IPC_TO_GUEST_PRIVATE_TYPECLIP + RP_IPC_TO_GUEST_PRIVATE_RELEASEKEYS + RP_IPC_TO_GUEST_PRIVATE_CANESCAPE + RP_IPC_TO_GUEST_PRIVATE_LOGGING + RP_IPC_TO_GUEST_PRIVATE_INPUTDEVICES +Description: + these are private messages, received by code in RPGuest.dll; + they never reach the message function in guest code diff --git a/od-win32/cloanto/RetroPlatformIPC.h b/od-win32/cloanto/RetroPlatformIPC.h index 44248e08..e849a66a 100644 --- a/od-win32/cloanto/RetroPlatformIPC.h +++ b/od-win32/cloanto/RetroPlatformIPC.h @@ -9,7 +9,7 @@ : Software Foundation. Authors : os, m Created : 2007-08-27 13:55:49 - Updated : 2017-01-04 06:15:00 + Updated : 2017-09-10 12:13:00 Comment : RetroPlatform Player interprocess communication include file *****************************************************************************/ @@ -18,9 +18,9 @@ #include -#define RETROPLATFORM_API_VER "7.1" +#define RETROPLATFORM_API_VER "7.2" #define RETROPLATFORM_API_VER_MAJOR 7 -#define RETROPLATFORM_API_VER_MINOR 1 +#define RETROPLATFORM_API_VER_MINOR 2 #define RPIPC_HostWndClass "RetroPlatformHost%s" #define RPIPC_GuestWndClass "RetroPlatformGuest%d" @@ -33,56 +33,65 @@ // Guest-to-Host Messages // **************************************************************************** -#define RP_IPC_TO_HOST_REGISTER (WM_APP + 0) -#define RP_IPC_TO_HOST_FEATURES (WM_APP + 1) -#define RP_IPC_TO_HOST_CLOSED (WM_APP + 2) -#define RP_IPC_TO_HOST_ACTIVATED (WM_APP + 3) -#define RP_IPC_TO_HOST_DEACTIVATED (WM_APP + 4) -#define RP_IPC_TO_HOST_ENABLED (WM_APP + 5) -#define RP_IPC_TO_HOST_DISABLED (WM_APP + 6) -#define RP_IPC_TO_HOST_SCREENMODE (WM_APP + 9) -#define RP_IPC_TO_HOST_POWERLED (WM_APP + 10) -#define RP_IPC_TO_HOST_DEVICES (WM_APP + 11) -#define RP_IPC_TO_HOST_DEVICEACTIVITY (WM_APP + 12) -#define RP_IPC_TO_HOST_MOUSECAPTURE (WM_APP + 13) -#define RP_IPC_TO_HOST_HOSTAPIVERSION (WM_APP + 14) -#define RP_IPC_TO_HOST_PAUSE (WM_APP + 15) -#define RP_IPC_TO_HOST_TURBO (WM_APP + 17) -#define RP_IPC_TO_HOST_PING (WM_APP + 18) -#define RP_IPC_TO_HOST_VOLUME (WM_APP + 19) -#define RP_IPC_TO_HOST_PARENT (WM_APP + 21) -#define RP_IPC_TO_HOST_DEVICESEEK (WM_APP + 22) -#define RP_IPC_TO_HOST_CLOSE (WM_APP + 23) -#define RP_IPC_TO_HOST_DEVICEREADWRITE (WM_APP + 24) -#define RP_IPC_TO_HOST_HOSTVERSION (WM_APP + 25) -#define RP_IPC_TO_HOST_INPUTDEVICE (WM_APP + 26) // introduced in RetroPlatform API 3.0 -#define RP_IPC_TO_HOST_DEVICECONTENT (WM_APP + 27) // extended in RetroPlatform API 3.0 -#define RP_IPC_TO_HOST_KEYBOARDLAYOUT (WM_APP + 30) // introduced in RetroPlatform API 7.1 - +#define RP_IPC_TO_HOST_PRIVATE_REGISTER (WM_APP + 0) +#define RP_IPC_TO_HOST_FEATURES (WM_APP + 1) +#define RP_IPC_TO_HOST_CLOSED (WM_APP + 2) +#define RP_IPC_TO_HOST_ACTIVATED (WM_APP + 3) +#define RP_IPC_TO_HOST_DEACTIVATED (WM_APP + 4) +#define RP_IPC_TO_HOST_ENABLED (WM_APP + 5) +#define RP_IPC_TO_HOST_DISABLED (WM_APP + 6) +#define RP_IPC_TO_HOST_SCREENMODE (WM_APP + 9) +#define RP_IPC_TO_HOST_POWERLED (WM_APP + 10) +#define RP_IPC_TO_HOST_DEVICES (WM_APP + 11) +#define RP_IPC_TO_HOST_DEVICEACTIVITY (WM_APP + 12) +#define RP_IPC_TO_HOST_MOUSECAPTURE (WM_APP + 13) +#define RP_IPC_TO_HOST_HOSTAPIVERSION (WM_APP + 14) +#define RP_IPC_TO_HOST_PAUSE (WM_APP + 15) +#define RP_IPC_TO_HOST_TURBO (WM_APP + 17) +#define RP_IPC_TO_HOST_PING (WM_APP + 18) +#define RP_IPC_TO_HOST_VOLUME (WM_APP + 19) +#define RP_IPC_TO_HOST_PARENT (WM_APP + 21) +#define RP_IPC_TO_HOST_DEVICESEEK (WM_APP + 22) +#define RP_IPC_TO_HOST_CLOSE (WM_APP + 23) +#define RP_IPC_TO_HOST_DEVICEREADWRITE (WM_APP + 24) +#define RP_IPC_TO_HOST_HOSTVERSION (WM_APP + 25) +#define RP_IPC_TO_HOST_INPUTDEVICE (WM_APP + 26) // introduced in RetroPlatform API 3.0 +#define RP_IPC_TO_HOST_DEVICECONTENT (WM_APP + 27) // extended in RetroPlatform API 3.0 +#define RP_IPC_TO_HOST_KEYBOARDLAYOUT (WM_APP + 30) // introduced in RetroPlatform API 7.1 +#define RP_IPC_TO_HOST_PRIVATE_SHAREDEVENT (WM_APP + 31) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_HOST_PRIVATE_TYPECLIPDONE (WM_APP + 32) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_HOST_PRIVATE_KEYEVENT (WM_APP + 33) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_HOST_PRIVATE_GUESTEVENT (WM_APP + 34) // introduced in RetroPlatform API 7.2 // **************************************************************************** // Host-to-Guest Messages // **************************************************************************** -#define RP_IPC_TO_GUEST_CLOSE (WM_APP + 200) -#define RP_IPC_TO_GUEST_SCREENMODE (WM_APP + 202) -#define RP_IPC_TO_GUEST_PAUSE (WM_APP + 204) -#define RP_IPC_TO_GUEST_RESET (WM_APP + 206) -#define RP_IPC_TO_GUEST_TURBO (WM_APP + 207) -#define RP_IPC_TO_GUEST_PING (WM_APP + 208) -#define RP_IPC_TO_GUEST_VOLUME (WM_APP + 209) -#define RP_IPC_TO_GUEST_EVENT (WM_APP + 211) -#define RP_IPC_TO_GUEST_MOUSECAPTURE (WM_APP + 212) -#define RP_IPC_TO_GUEST_SAVESTATE (WM_APP + 213) -#define RP_IPC_TO_GUEST_LOADSTATE (WM_APP + 214) -#define RP_IPC_TO_GUEST_FLUSH (WM_APP + 215) -#define RP_IPC_TO_GUEST_DEVICEREADWRITE (WM_APP + 216) -#define RP_IPC_TO_GUEST_QUERYSCREENMODE (WM_APP + 217) -#define RP_IPC_TO_GUEST_GUESTAPIVERSION (WM_APP + 218) // introduced in RetroPlatform API 3.0 -#define RP_IPC_TO_GUEST_DEVICECONTENT (WM_APP + 219) // extended in RetroPlatform API 3.0 -#define RP_IPC_TO_GUEST_SCREENCAPTURE (WM_APP + 220) // extended in RetroPlatform API 3.4 -#define RP_IPC_TO_GUEST_DEVICEACTIVITY (WM_APP + 221) // introduced in RetroPlatform API 7.1 -#define RP_IPC_TO_GUEST_SHOWOPTIONS (WM_APP + 222) // introduced in RetroPlatform API 7.1 +#define RP_IPC_TO_GUEST_CLOSE (WM_APP + 200) +#define RP_IPC_TO_GUEST_SCREENMODE (WM_APP + 202) +#define RP_IPC_TO_GUEST_PAUSE (WM_APP + 204) +#define RP_IPC_TO_GUEST_RESET (WM_APP + 206) +#define RP_IPC_TO_GUEST_TURBO (WM_APP + 207) +#define RP_IPC_TO_GUEST_PING (WM_APP + 208) +#define RP_IPC_TO_GUEST_VOLUME (WM_APP + 209) +#define RP_IPC_TO_GUEST_EVENT (WM_APP + 211) +#define RP_IPC_TO_GUEST_MOUSECAPTURE (WM_APP + 212) +#define RP_IPC_TO_GUEST_SAVESTATE (WM_APP + 213) +#define RP_IPC_TO_GUEST_LOADSTATE (WM_APP + 214) +#define RP_IPC_TO_GUEST_FLUSH (WM_APP + 215) +#define RP_IPC_TO_GUEST_DEVICEREADWRITE (WM_APP + 216) +#define RP_IPC_TO_GUEST_QUERYSCREENMODE (WM_APP + 217) +#define RP_IPC_TO_GUEST_GUESTAPIVERSION (WM_APP + 218) // introduced in RetroPlatform API 3.0 +#define RP_IPC_TO_GUEST_DEVICECONTENT (WM_APP + 219) // extended in RetroPlatform API 3.0 +#define RP_IPC_TO_GUEST_SCREENCAPTURE (WM_APP + 220) // extended in RetroPlatform API 3.4 +#define RP_IPC_TO_GUEST_DEVICEACTIVITY (WM_APP + 221) // introduced in RetroPlatform API 7.1 +#define RP_IPC_TO_GUEST_SHOWOPTIONS (WM_APP + 222) // introduced in RetroPlatform API 7.1 +#define RP_IPC_TO_GUEST_PRIVATE_STARTUP (WM_APP + 223) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_GUEST_PRIVATE_TYPECLIP (WM_APP + 224) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_GUEST_PRIVATE_RELEASEKEYS (WM_APP + 225) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_GUEST_PRIVATE_CANESCAPE (WM_APP + 226) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_GUEST_PRIVATE_LOGGING (WM_APP + 227) // introduced in RetroPlatform API 7.2 +#define RP_IPC_TO_GUEST_PRIVATE_INPUTDEVICES (WM_APP + 228) // introduced in RetroPlatform API 7.2 // **************************************************************************** // Message Data Structures and Defines @@ -464,6 +473,23 @@ typedef struct RPScreenCapture #define RP_MAKE_HOSTVERSION(major,minor,build) ((LPARAM) (((LPARAM)((major) & 0xFFF)<<20) | ((LPARAM)((minor) & 0x3FF)<<10) | ((LPARAM)((build) & 0x3FF)))) +// RP_IPC_TO_HOST_PRIVATE_SHAREDEVENT wParam +#define RP_SHARED_EVENT_ESCAPE 1 +#define RP_SHARED_EVENT_TURBO 2 +#define RP_SHARED_EVENT_PAUSE 3 +#define RP_SHARED_EVENT_SCREENCAPTURECLIP 4 +#define RP_SHARED_EVENT_SCREENCAPTUREFILE 5 +#define RP_SHARED_EVENT_PLUGINOPTIONS 6 +// RP_IPC_TO_HOST_PRIVATE_SHAREDEVENT lParam +#define RP_SHARED_EVENT_PRESSED 0x0000 +#define RP_SHARED_EVENT_RELEASED 0x0001 + +// RP_IPC_TO_GUEST_PRIVATE_TYPECLIP return code +#define PRIVATETYPECLIP_NOTIMPL 0 +#define PRIVATETYPECLIP_FAILED 1 +#define PRIVATETYPECLIP_SUCCEDED 2 +#define PRIVATETYPECLIP_INPROGRESS 3 // a RP_IPC_TO_HOST_PRIVATE_TYPECLIPDONE will be sent when done + // Legacy Compatibility #ifndef RP_NO_LEGACY // Changed in 7.0 @@ -512,7 +538,7 @@ typedef struct RPDeviceContent_Legacy #define RP_IPD_KEYBDL2 L"KeyboardLayout2" // \0\0-terminated second joystick emulation keyboard layout (e.g. Keyboard Layout B for WinUAE) #define RP_IPD_KEYBDL3 L"KeyboardLayout3" // \0\0-terminated third joystick emulation keyboard layout (e.g. Keyboard Layout C for WinUAE) // Messages -#define RPIPCGM_REGISTER RP_IPC_TO_HOST_REGISTER +#define RPIPCGM_REGISTER RP_IPC_TO_HOST_PRIVATE_REGISTER #define RPIPCGM_FEATURES RP_IPC_TO_HOST_FEATURES #define RPIPCGM_CLOSED RP_IPC_TO_HOST_CLOSED #define RPIPCGM_ACTIVATED RP_IPC_TO_HOST_ACTIVATED