diff options
author | blythe%netscape.com <devnull@localhost> | 2002-02-08 21:56:21 +0000 |
---|---|---|
committer | blythe%netscape.com <devnull@localhost> | 2002-02-08 21:56:21 +0000 |
commit | 44ae2c56c48c0b365f172b66d55f2186c26e8dc0 (patch) | |
tree | 64c13df41c9763b1804d655d71f2aa414b4f9bfa | |
parent | 23ce721903fe29d95f36d63bc90b45cdce609ac8 (diff) | |
download | nspr-hg-44ae2c56c48c0b365f172b66d55f2186c26e8dc0.tar.gz |
eliminate a few more unresolved externals
-rw-r--r-- | pr/src/md/windows/w32time.c | 5 | ||||
-rw-r--r-- | pr/src/md/windows/w32unicode.c | 93 | ||||
-rw-r--r-- | pr/src/md/windows/w95thred.c | 4 |
3 files changed, 97 insertions, 5 deletions
diff --git a/pr/src/md/windows/w32time.c b/pr/src/md/windows/w32time.c index 78233114..11a97e1e 100644 --- a/pr/src/md/windows/w32time.c +++ b/pr/src/md/windows/w32time.c @@ -207,10 +207,9 @@ size_t Winstrftime(char *strDest, size_t maxsize, const char *format, const stru /* ** FIXME TODO ** - ** More here. - ** - ** Use GetTimeFormat and GetDateFormat + ** Use GetTimeFormat and GetDateFormat to implement this for real. */ + PR_ASSERT(0); return retval; } diff --git a/pr/src/md/windows/w32unicode.c b/pr/src/md/windows/w32unicode.c index 467fed06..31b9cad3 100644 --- a/pr/src/md/windows/w32unicode.c +++ b/pr/src/md/windows/w32unicode.c @@ -132,11 +132,15 @@ LPWSTR _PR_MD_A2W(LPCSTR inString, LPWSTR outWideString, int inWideStringChars) ** This is similar to what NT does to support the funcAs. */ -void OutputDebugStringA(LPCSTR inString) +VOID +WINAPI +OutputDebugStringA( + LPCSTR lpOutputString + ) { LPWSTR str = NULL; - str = _PR_MD_MALLOC_A2W(inString); + str = _PR_MD_MALLOC_A2W(lpOutputString); if(NULL != str) { OutputDebugStringW(str); @@ -148,4 +152,89 @@ void OutputDebugStringA(LPCSTR inString) } } +HINSTANCE +WINAPI +LoadLibraryA( + LPCSTR lpLibFileName + ) +{ + HINSTANCE retval = NULL; + LPWSTR wideStr = NULL; + WCHAR widePath[MAX_PATH + 1]; + + wideStr = _PR_MD_A2W(lpLibFileName, widePath, sizeof(widePath) / sizeof(WCHAR)); + if(NULL != wideStr) + { + retval = LoadLibraryW(wideStr); + } + else + { + PR_SetError(PR_NAME_TOO_LONG_ERROR, 0); + } + + return retval; +} + +BOOL +WINAPI +CreateProcessA ( + LPCSTR pszImageName, + LPCSTR pszCmdLine, + LPSECURITY_ATTRIBUTES psaProcess, + LPSECURITY_ATTRIBUTES psaThread, + BOOL fInheritHandles, + DWORD fdwCreate, + LPVOID pvEnvironment, + LPSTR pszCurDir, + LPSTARTUPINFO psiStartInfo, + LPPROCESS_INFORMATION pProcInfo + ) +{ + BOOL retval = FALSE; + LPWSTR wideImageName = NULL; + + wideImageName = _PR_MD_MALLOC_A2W(pszImageName); + if(NULL != wideImageName) + { + LPWSTR wideCmdLine = NULL; + + wideCmdLine = _PR_MD_MALLOC_A2W(pszCmdLine); + if(NULL == pszCmdLine || NULL != wideCmdLine) + { + LPWSTR wideCurDir = NULL; + WCHAR widePath[MAX_PATH + 1]; + + wideCurDir = _PR_MD_A2W(pszCurDir, widePath, sizeof(widePath) / sizeof(WCHAR)); + retval = CreateProcessW( + wideImageName, + wideCmdLine, + psaProcess, + psaThread, + fInheritHandles, + fdwCreate, + pvEnvironment, + wideCurDir, + psiStartInfo, + pProcInfo); + + if(NULL != wideCmdLine) + { + PR_Free(wideCmdLine); + } + } + else + { + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + } + + PR_Free(wideImageName); + } + else + { + PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); + } + + return retval; +} + #endif /* WINCE */
\ No newline at end of file diff --git a/pr/src/md/windows/w95thred.c b/pr/src/md/windows/w95thred.c index f8058906..d7c31df9 100644 --- a/pr/src/md/windows/w95thred.c +++ b/pr/src/md/windows/w95thred.c @@ -234,7 +234,11 @@ _PR_MD_EXIT_THREAD(PRThread *thread) void _PR_MD_EXIT(PRIntn status) { +#if !defined(WINCE) _exit(status); +#else + TerminateProcess(GetCurrentProcess(), status); +#endif } PRInt32 _PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask ) |