diff --git a/build/wince/shunt/build/shunt.vcb b/build/wince/shunt/build/shunt.vcb index 1f51590fe920..42117daed035 100755 Binary files a/build/wince/shunt/build/shunt.vcb and b/build/wince/shunt/build/shunt.vcb differ diff --git a/build/wince/shunt/build/shunt.vco b/build/wince/shunt/build/shunt.vco index ed3cf2699586..211b1d7a79dd 100755 Binary files a/build/wince/shunt/build/shunt.vco and b/build/wince/shunt/build/shunt.vco differ diff --git a/build/wince/shunt/include/mozce_shunt.h b/build/wince/shunt/include/mozce_shunt.h index bc835e9f81fc..5342b0b87b95 100755 --- a/build/wince/shunt/include/mozce_shunt.h +++ b/build/wince/shunt/include/mozce_shunt.h @@ -441,7 +441,18 @@ #ifdef ExpandEnvironmentStrings #undef ExpandEnvironmentStrings #endif -#define ExpandEnvironmentStrings mozce_ExpandEnvironmentStrings + +#ifdef ExpandEnvironmentStringsA +#undef ExpandEnvironmentStringsA +#endif + +#ifdef ExpandEnvironmentStringsW +#undef ExpandEnvironmentStringsW +#endif + +#define ExpandEnvironmentStrings mozce_ExpandEnvironmentStrings +#define ExpandEnvironmentStringsA mozce_ExpandEnvironmentStrings +#define ExpandEnvironmentStringsW mozce_ExpandEnvironmentStringsW #ifdef FIXED #undef FIXED @@ -676,6 +687,11 @@ #endif #define SetWindowTextA mozce_SetWindowTextA +#ifdef ShellExecute +#undef ShellExecute +#endif +#define ShellExecute mozce_ShellExecute + #ifdef TlsAlloc #undef TlsAlloc #endif @@ -1344,6 +1360,7 @@ extern "C" { MOZCE_SHUNT_API int mozce_SetStretchBltMode(HDC inDC, int inStretchMode); MOZCE_SHUNT_API int mozce_ExtSelectClipRgn(HDC inDC, HRGN inRGN, int inMode); MOZCE_SHUNT_API DWORD mozce_ExpandEnvironmentStrings(LPCTSTR lpSrc, LPTSTR lpDst, DWORD nSize); + MOZCE_SHUNT_API DWORD mozce_ExpandEnvironmentStringsW(const unsigned short * lpSrc, const unsigned short * lpDst, DWORD nSize); MOZCE_SHUNT_API BOOL mozce_LineDDA(int inXStart, int inYStart, int inXEnd, int inYEnd, mozce_LINEDDAPROC inLineFunc, LPARAM inData); MOZCE_SHUNT_API int mozce_FrameRect(HDC inDC, CONST RECT *inRect, HBRUSH inBrush); @@ -1367,6 +1384,7 @@ extern "C" { MOZCE_SHUNT_API BOOL mozce_IsIconic(HWND inWnd); MOZCE_SHUNT_API BOOL mozce_OpenIcon(HWND inWnd); MOZCE_SHUNT_API HHOOK mozce_SetWindowsHookEx(int inType, void* inFunc, HINSTANCE inMod, DWORD inThreadId); + MOZCE_SHUNT_API HINSTANCE mozce_ShellExecute(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd); MOZCE_SHUNT_API BOOL mozce_UnhookWindowsHookEx(HHOOK inHook); MOZCE_SHUNT_API LRESULT mozce_CallNextHookEx(HHOOK inHook, int inCode, WPARAM wParam, LPARAM lParam); MOZCE_SHUNT_API BOOL mozce_GetWindowPlacement(HWND window, WINDOWPLACEMENT *lpwndpl); diff --git a/build/wince/shunt/win32.cpp b/build/wince/shunt/win32.cpp index ea4ec6d772b1..4a21555c99ae 100755 --- a/build/wince/shunt/win32.cpp +++ b/build/wince/shunt/win32.cpp @@ -1091,6 +1091,17 @@ MOZCE_SHUNT_API DWORD mozce_ExpandEnvironmentStrings(LPCTSTR lpSrc, LPTSTR lpDst return 0; } +MOZCE_SHUNT_API DWORD mozce_ExpandEnvironmentStringsW(LPCTSTR lpSrc, LPTSTR lpDst, DWORD nSize) +{ + MOZCE_PRECHECK + +#ifdef DEBUG + mozce_printf("mozce_ExpandEnvironmentStrings called\n"); +#endif + + return 0; +} + MOZCE_SHUNT_API BOOL mozce_GdiFlush(void) { MOZCE_PRECHECK @@ -1115,6 +1126,43 @@ MOZCE_SHUNT_API BOOL mozce_GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT *lpwndp return TRUE; } +MOZCE_SHUNT_API HINSTANCE mozce_ShellExecute(HWND hwnd, + LPCSTR lpOperation, + LPCSTR lpFile, + LPCSTR lpParameters, + LPCSTR lpDirectory, + INT nShowCmd) +{ + + LPTSTR op = a2w_malloc(lpOperation, -1, NULL); + LPTSTR file = a2w_malloc(lpFile, -1, NULL); + LPTSTR parm = a2w_malloc(lpParameters, -1, NULL); + LPTSTR dir = a2w_malloc(lpDirectory, -1, NULL); + + SHELLEXECUTEINFO info; + info.cbSize = sizeof(SHELLEXECUTEINFO); + info.fMask = SEE_MASK_NOCLOSEPROCESS; + info.hwnd = hwnd; + info.lpVerb = op; + info.lpFile = file; + info.lpParameters = parm; + info.lpDirectory = dir; + info.nShow = nShowCmd; + + BOOL b = ShellExecuteEx(&info); + + if (op) + free(op); + if (file) + free(file); + if (parm) + free(parm); + if (dir) + free(dir); + + return (HINSTANCE) info.hProcess; +} + #if 0 { #endif @@ -1124,7 +1172,7 @@ void dumpMemoryInfo() { MEMORYSTATUS ms; ms.dwLength = sizeof(MEMORYSTATUS); - + GlobalMemoryStatus(&ms); diff --git a/build/wince/shunt/win32A.cpp b/build/wince/shunt/win32A.cpp index e163fbf742bc..c7305d4d7b65 100755 --- a/build/wince/shunt/win32A.cpp +++ b/build/wince/shunt/win32A.cpp @@ -236,25 +236,17 @@ MOZCE_SHUNT_API BOOL mozce_CreateProcessA(LPCSTR pszImageName, LPCSTR pszCmdLine #ifdef DEBUG mozce_printf("mozce_CreateProcessA called\n"); #endif - - BOOL retval = FALSE; - TCHAR pszImageNameW[MAX_PATH]; - - if(a2w_buffer(pszImageName, -1, pszImageNameW, MAX_PATH)) - { - LPTSTR pszCmdLineW = NULL; - - pszCmdLineW = a2w_malloc(pszCmdLine, -1, NULL); - if(NULL != pszCmdLineW || NULL == pszCmdLine) - { - retval = CreateProcessW(pszImageNameW, pszCmdLineW, NULL, NULL, FALSE, fdwCreate, NULL, NULL, NULL, pProcInfo); - - if(NULL != pszCmdLineW) - { - free(pszCmdLineW); - } - } - } + + LPTSTR image = a2w_malloc(pszImageName, -1, NULL); + LPTSTR cmdline = a2w_malloc(pszCmdLine, -1, NULL); + + BOOL retval = CreateProcessW(image, cmdline, NULL, NULL, FALSE, fdwCreate, NULL, NULL, NULL, pProcInfo); + + if (image) + free(image); + + if (cmdline) + free(cmdline); return retval; }