diff --git a/build/wince/shunt/include/mozce_shunt.h b/build/wince/shunt/include/mozce_shunt.h index 75b2030c0ad3..65751b823117 100755 --- a/build/wince/shunt/include/mozce_shunt.h +++ b/build/wince/shunt/include/mozce_shunt.h @@ -39,6 +39,9 @@ #ifndef MOZCE_SHUNT_H #define MOZCE_SHUNT_H +// This is to silence the #pragma deprecated warnings +#pragma warning(disable: 4068) + #include "mozce_defs.h" #include @@ -962,6 +965,21 @@ #endif #define RegQueryValueExA mozce_RegQueryValueExA +#ifdef RegSetValueExA +#undef RegSetValueExA +#endif +#define RegSetValueExA mozce_RegSetValueExA + +#ifdef RegCreateKeyExA +#undef RegCreateKeyExA +#endif +#define RegCreateKeyExA mozce_RegCreateKeyExA + +#ifdef RegDeleteValueA +#undef RegDeleteValueA +#endif +#define RegDeleteValueA mozce_RegDeleteValueA + #ifdef RegisterClassA #undef RegisterClassA #endif @@ -1327,6 +1345,12 @@ extern "C" { MOZCE_SHUNT_API LONG mozce_RegEnumKeyExA(HKEY inKey, DWORD inIndex, LPSTR outName, LPDWORD inoutName, LPDWORD inReserved, LPSTR outClass, LPDWORD inoutClass, PFILETIME inLastWriteTime); MOZCE_SHUNT_API LONG mozce_RegOpenKeyExA(HKEY inKey, LPCSTR inSubKey, DWORD inOptions, REGSAM inSAM, PHKEY outResult); MOZCE_SHUNT_API LONG mozce_RegQueryValueExA(HKEY inKey, LPCSTR inValueName, LPDWORD inReserved, LPDWORD outType, LPBYTE inoutBData, LPDWORD inoutDData); + + MOZCE_SHUNT_API LONG mozce_RegSetValueExA(HKEY hKey, const char *valname, DWORD dwReserved, DWORD dwType, const BYTE* lpData, DWORD dwSize); + MOZCE_SHUNT_API LONG mozce_RegCreateKeyExA(HKEY hKey, const char *subkey, DWORD dwRes, LPSTR lpszClass, DWORD ulOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES sec_att, PHKEY phkResult, DWORD *lpdwDisp); + + MOZCE_SHUNT_API LONG mozce_RegDeleteValueA(HKEY hKey, LPCTSTR lpValueName); + MOZCE_SHUNT_API LRESULT mozce_DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); MOZCE_SHUNT_API LRESULT mozce_PostMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); MOZCE_SHUNT_API LRESULT mozce_SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); diff --git a/build/wince/shunt/win32A.cpp b/build/wince/shunt/win32A.cpp index 38a1ad8d1d78..be3586b2240b 100755 --- a/build/wince/shunt/win32A.cpp +++ b/build/wince/shunt/win32A.cpp @@ -405,6 +405,74 @@ MOZCE_SHUNT_API LONG mozce_RegQueryValueExA(HKEY inKey, LPCSTR inValueName, LPDW return retval; } + + +MOZCE_SHUNT_API LONG mozce_RegSetValueExA(HKEY hKey, const char *valname, DWORD dwReserved, DWORD dwType, LPBYTE lpData, DWORD dwSize) +{ + MOZCE_PRECHECK + +#ifdef DEBUG + mozce_printf("mozce_RegSetValueExA called\n"); +#endif + + wchar_t valnamew[256]; + LONG res; + + LPBYTE lpDataNew = lpData; + DWORD dwDataSize = dwSize; + + MultiByteToWideChar(CP_ACP, 0, valname, -1, valnamew, charcount(valnamew)); + + if(dwType == REG_SZ || dwType == REG_EXPAND_SZ) + { + dwDataSize = dwSize * 2; + lpDataNew = (LPBYTE) malloc(dwDataSize); + + MultiByteToWideChar(CP_ACP, 0, (const char*) lpData, -1, (wchar_t *)lpDataNew, dwDataSize); + } + + res = RegSetValueExW(hKey, valnamew, dwReserved, dwType, lpDataNew, dwDataSize); + + free(lpDataNew); + + return res; + +} + +MOZCE_SHUNT_API LONG mozce_RegCreateKeyExA(HKEY hKey, const char *subkey, DWORD dwRes, LPSTR lpszClass, DWORD ulOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES sec_att, PHKEY phkResult, DWORD *lpdwDisp) +{ + MOZCE_PRECHECK + +#ifdef DEBUG + mozce_printf("mozce_RegCreateKeyExA called\n"); +#endif + + LPTSTR wName = a2w_malloc(subkey, -1, NULL); + + long res = RegCreateKeyExW(hKey, wName, dwRes, NULL, ulOptions, samDesired, NULL, phkResult, lpdwDisp); + + free(wName); + return res; +} + + +MOZCE_SHUNT_API LONG mozce_RegDeleteValueA(HKEY hKey, LPCSTR lpValueName) +{ + MOZCE_PRECHECK + +#ifdef DEBUG + mozce_printf("mozce_RegDeleteValueA called\n"); +#endif + + LPTSTR wName = a2w_malloc(lpValueName, -1, NULL); + long res = RegDeleteKeyW(hKey, wName); + + free(wName); + return res; +} + + + MOZCE_SHUNT_API int mozce_MessageBoxA(HWND inWnd, LPCSTR inText, LPCSTR inCaption, UINT uType) { MOZCE_PRECHECK