summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblythe%netscape.com <devnull@localhost>2002-02-05 21:33:03 +0000
committerblythe%netscape.com <devnull@localhost>2002-02-05 21:33:03 +0000
commitc46c20e61e3c7cfc796ae9d533055d854b279b5a (patch)
tree9d6e0eebf95b9faa3ef843c1b7a66cb350a181a9
parent4fce542a14d0f35141d3ae59b380124f3d1c64d5 (diff)
downloadnspr-hg-c46c20e61e3c7cfc796ae9d533055d854b279b5a.tar.gz
more win32 differences in WINCE.
-rw-r--r--pr/src/md/windows/ntmisc.c41
-rw-r--r--pr/src/md/windows/ntsec.c9
-rw-r--r--pr/src/md/windows/w95thred.c25
3 files changed, 73 insertions, 2 deletions
diff --git a/pr/src/md/windows/ntmisc.c b/pr/src/md/windows/ntmisc.c
index 5efe3038..0516a14c 100644
--- a/pr/src/md/windows/ntmisc.c
+++ b/pr/src/md/windows/ntmisc.c
@@ -545,6 +545,8 @@ errorExit:
BOOL retVal;
char *cmdLine = NULL;
PRProcess *proc = NULL;
+ LPWSTR cePath = NULL;
+ LPWSTR ceCmdLine = NULL;
proc = PR_NEW(PRProcess);
if (!proc) {
@@ -557,8 +559,27 @@ errorExit:
goto errorExit;
}
- retVal = CreateProcess(path,
- cmdLine,
+ if(NULL != path)
+ {
+ cePath = _PR_MD_MALLOC_A2W(path);
+ if(NULL == cePath)
+ {
+ PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
+ goto errorExit;
+ }
+ }
+ if(NULL != cmdLine)
+ {
+ ceCmdLine = _PR_MD_MALLOC_A2W(cmdLine);
+ if(NULL == ceCmdLine)
+ {
+ PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
+ goto errorExit;
+ }
+ }
+
+ retVal = CreateProcess(cePath,
+ ceCmdLine,
NULL, /* not supported */
NULL, /* not supported */
FALSE, /* not supported */
@@ -578,10 +599,26 @@ errorExit:
proc->md.handle = procInfo.hProcess;
proc->md.id = procInfo.dwProcessId;
+ if(cePath)
+ {
+ PR_Free(cePath);
+ }
+ if(ceCmdLine)
+ {
+ PR_Free(ceCmdLine);
+ }
PR_DELETE(cmdLine);
return proc;
errorExit:
+ if(cePath)
+ {
+ PR_Free(cePath);
+ }
+ if(ceCmdLine)
+ {
+ PR_Free(ceCmdLine);
+ }
if (cmdLine) {
PR_DELETE(cmdLine);
}
diff --git a/pr/src/md/windows/ntsec.c b/pr/src/md/windows/ntsec.c
index e08444e6..67285675 100644
--- a/pr/src/md/windows/ntsec.c
+++ b/pr/src/md/windows/ntsec.c
@@ -66,6 +66,7 @@ static struct {
*/
void _PR_NT_InitSids(void)
{
+#if !defined(WINCE)
SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
HANDLE hToken = NULL; /* initialized to an arbitrary value to
* silence a Purify UMR warning */
@@ -125,6 +126,7 @@ void _PR_NT_InitSids(void)
0, 0, 0, 0, 0, 0, 0,
&_pr_nt_sids.everyone);
PR_ASSERT(rv != 0);
+#endif /* !WINCE */
}
/*
@@ -142,9 +144,11 @@ _PR_NT_FreeSids(void)
if (_pr_nt_sids.group) {
PR_Free(_pr_nt_sids.group);
}
+#if !defined(WINCE)
if (_pr_nt_sids.everyone) {
FreeSid(_pr_nt_sids.everyone);
}
+#endif
}
/*
@@ -165,6 +169,7 @@ _PR_NT_MakeSecurityDescriptorACL(
PSECURITY_DESCRIPTOR *resultSD,
PACL *resultACL)
{
+#if !defined(WINCE)
PSECURITY_DESCRIPTOR pSD = NULL;
PACL pACL = NULL;
DWORD cbACL; /* size of ACL */
@@ -258,6 +263,10 @@ failed:
PR_Free(pACL);
}
return PR_FAILURE;
+#else
+ PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
+ return PR_FAILURE;
+#endif /* !WINCE */
}
/*
diff --git a/pr/src/md/windows/w95thred.c b/pr/src/md/windows/w95thred.c
index 2453e271..f8058906 100644
--- a/pr/src/md/windows/w95thred.c
+++ b/pr/src/md/windows/w95thred.c
@@ -90,6 +90,7 @@ _PR_MD_INIT_THREAD(PRThread *thread)
** suspending). Therefore, get a real handle from
** the pseudo handle via DuplicateHandle(...)
*/
+#if !defined(WINCE)
DuplicateHandle(
GetCurrentProcess(), /* Process of source handle */
GetCurrentThread(), /* Pseudo Handle to dup */
@@ -98,6 +99,12 @@ _PR_MD_INIT_THREAD(PRThread *thread)
0L, /* access flags */
FALSE, /* Inheritable */
DUPLICATE_SAME_ACCESS); /* Options */
+#else
+ /*
+ ** On WinCE the thread ID is the same as the real thread handle.
+ */
+ thread->md.handle = (HANDLE)GetCurrentThreadId();
+#endif
}
/* Create the blocking IO semaphore */
@@ -117,6 +124,7 @@ _PR_MD_CREATE_THREAD(PRThread *thread,
PRUint32 stackSize)
{
+#if !defined(WINCE)
thread->md.handle = (HANDLE) _beginthreadex(
NULL,
thread->stack->stackSize,
@@ -128,6 +136,15 @@ _PR_MD_CREATE_THREAD(PRThread *thread,
(void *)thread,
CREATE_SUSPENDED,
&(thread->id));
+#else
+ thread->md.handle = CreateThread(NULL,
+ (DWORD)thread->stack->stackSize,
+ (LPTHREAD_START_ROUTINE)start,
+ (LPVOID)thread,
+ (DWORD)CREATE_SUSPENDED,
+ (LPDWORD)&(thread->id));
+#endif /* !WINCE */
+
if(!thread->md.handle) {
return PR_FAILURE;
}
@@ -222,20 +239,28 @@ _PR_MD_EXIT(PRIntn status)
PRInt32 _PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask )
{
+#if !defined(WINCE)
int rv;
rv = SetThreadAffinityMask(thread->md.handle, mask);
return rv?0:-1;
+#else
+ return -1;
+#endif
}
PRInt32 _PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask)
{
+#if !defined(WINCE)
PRInt32 rv, system_mask;
rv = GetProcessAffinityMask(GetCurrentProcess(), mask, &system_mask);
return rv?0:-1;
+#else
+ return -1;
+#endif
}
void