summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/threading
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@microsoft.com>2015-08-21 11:43:34 -0700
committerKoundinya Veluri <kouvel@microsoft.com>2015-08-26 21:35:47 -0700
commit96846758a0df94985aedc6c301a8576ee1f1da4b (patch)
tree45206616b8e94b745fdcca3a4a76f030443b2c4a /src/pal/tests/palsuite/threading
parentb7d38a0ff5a4faa3ed6da5b8e0e375b9e91e6a77 (diff)
downloadcoreclr-96846758a0df94985aedc6c301a8576ee1f1da4b.tar.gz
coreclr-96846758a0df94985aedc6c301a8576ee1f1da4b.tar.bz2
coreclr-96846758a0df94985aedc6c301a8576ee1f1da4b.zip
Return error upon attemping to create named objects in PAL.
Update PAL APIs that create named objects (mutex, semaphore, event, file mapping) to return a not-supported error code. It was decided to not support cross-process synchronization in PAL at present time due to complexities involved in reliably emulating Windows' behavior. @stephentoub has already made changes on the FX side to throw PlatformNotSupportedException in these cases. Related to issue #1237.
Diffstat (limited to 'src/pal/tests/palsuite/threading')
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventA/test1/test1.c12
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventA/test2/test2.c12
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventW/test1/test1.c15
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventW/test2/test2.c15
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test1/test1.c18
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test2/test2.c3
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test3/test3.c3
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test4/test4.c3
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test1/test1.c18
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test2/test2.c3
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test3/test3.c3
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test4/test4.c3
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.c40
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.c41
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c6
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c7
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c23
17 files changed, 72 insertions, 153 deletions
diff --git a/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.c b/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.c
index 8a90c76985..9f9c570184 100644
--- a/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.c
@@ -34,7 +34,6 @@ BOOL CreateEventTest()
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = TRUE;
- LPCTSTR lpName = "Event #1";
/* Call CreateEvent, and check to ensure the returned HANDLE is a
valid event HANDLE
@@ -43,7 +42,7 @@ BOOL CreateEventTest()
HANDLE hEvent = CreateEvent( lpEventAttributes,
bManualReset,
bInitialState,
- lpName);
+ NULL);
if (hEvent != NULL)
{
@@ -54,8 +53,7 @@ BOOL CreateEventTest()
if (dwRet != WAIT_OBJECT_0)
{
- Trace("CreateEventTest:WaitForSingleObject %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CreateEventTest:WaitForSingleObject failed (%x)\n", GetLastError());
}
else
{
@@ -67,15 +65,13 @@ BOOL CreateEventTest()
if (!bRet)
{
- Trace("CreateEventTest:CloseHandle %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CreateEventTest:CloseHandle failed (%x)\n", GetLastError());
}
}
}
else
{
- Trace("CreateEventTest:CreateEvent %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CreateEventTest:CreateEvent failed (%x)\n", GetLastError());
}
return bRet;
diff --git a/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.c b/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.c
index 1079459b8a..d7c888234d 100644
--- a/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.c
@@ -24,14 +24,13 @@ BOOL CreateEventTest()
LPSECURITY_ATTRIBUTES lpEventAttributes = 0;
BOOL bManualReset = TRUE;
BOOL bInitialState = FALSE;
- LPCTSTR lpName = "Event #2";
/* Create an event with the Initial State set to FALSE */
HANDLE hEvent = CreateEvent( lpEventAttributes,
bManualReset,
bInitialState,
- lpName);
+ NULL);
if (hEvent != NULL)
{
@@ -43,8 +42,7 @@ BOOL CreateEventTest()
if (dwRet != WAIT_TIMEOUT)
{
- Trace("CloseEventTest:WaitForSingleObject %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CloseEventTest:WaitForSingleObject failed (%x)\n", GetLastError());
}
else
{
@@ -57,15 +55,13 @@ BOOL CreateEventTest()
if (!bRet)
{
- Trace("CloseEventTest:CloseHandle %s failed "
- " (%x)\n",lpName,GetLastError());
+ Trace("CloseEventTest:CloseHandle failed (%x)\n", GetLastError());
}
}
}
else
{
- Trace("CloseEventTest:CreateEvent %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CloseEventTest:CreateEvent failed (%x)\n", GetLastError());
}
return bRet;
diff --git a/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.c b/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.c
index feee22c401..0f666753a9 100644
--- a/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.c
@@ -29,18 +29,16 @@ BOOL CreateEventTest()
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = TRUE;
- WCHAR TheName[] = {'E','v','e','n','t','\0'};
- LPWSTR lpName = TheName;
/*
* Call CreateEvent, and check to ensure the returned HANDLE is a
* valid event HANDLE
*/
- HANDLE hEvent = CreateEvent( lpEventAttributes,
+ HANDLE hEvent = CreateEventW(lpEventAttributes,
bManualReset,
bInitialState,
- lpName);
+ NULL);
if (hEvent != NULL)
{
@@ -52,8 +50,7 @@ BOOL CreateEventTest()
if (dwRet != WAIT_OBJECT_0)
{
- Trace("CreateEventTest:WaitForSingleObject %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CreateEventTest:WaitForSingleObject failed (%x)\n", GetLastError());
}
else
{
@@ -66,15 +63,13 @@ BOOL CreateEventTest()
if (!bRet)
{
- Trace("CreateEventTest:CloseHandle %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CreateEventTest:CloseHandle failed (%x)\n", GetLastError());
}
}
}
else
{
- Trace("CreateEventTest:CreateEvent %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CreateEventTest:CreateEvent failed (%x)\n", GetLastError());
}
return bRet;
diff --git a/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.c b/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.c
index c85c6545fb..c0df4651b7 100644
--- a/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.c
@@ -24,16 +24,14 @@ BOOL CreateEventTest()
LPSECURITY_ATTRIBUTES lpEventAttributes = 0;
BOOL bManualReset = TRUE;
BOOL bInitialState = FALSE;
- WCHAR TheName[] = {'E','v','e','n','t','\0'};
- LPWSTR lpName = TheName;
/* Create an event with the Initial State set to FALSE */
- HANDLE hEvent = CreateEvent( lpEventAttributes,
+ HANDLE hEvent = CreateEventW(lpEventAttributes,
bManualReset,
bInitialState,
- lpName);
+ NULL);
if (hEvent != NULL)
{
@@ -45,8 +43,7 @@ BOOL CreateEventTest()
if (dwRet != WAIT_TIMEOUT)
{
- Trace("CloseEventTest:WaitForSingleObject %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CloseEventTest:WaitForSingleObject failed (%x)\n", GetLastError());
}
else
{
@@ -59,15 +56,13 @@ BOOL CreateEventTest()
if (!bRet)
{
- Trace("CloseEventTest:CloseHandle %s failed "
- " (%x)\n",lpName,GetLastError());
+ Trace("CloseEventTest:CloseHandle failed (%x)\n", GetLastError());
}
}
}
else
{
- Trace("CloseEventTest:CreateEvent %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("CloseEventTest:CreateEvent failed (%x)\n", GetLastError());
}
return bRet;
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.c b/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.c
index c0122e5946..901f19c132 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.c
@@ -24,11 +24,10 @@ BOOL ResetEventTest()
LPSECURITY_ATTRIBUTES lpEventAttributes = 0;
BOOL bManualReset = TRUE;
BOOL bInitialState = TRUE;
- LPCTSTR lpName = "Event #4";
/* Create an Event, ensure it is valid */
HANDLE hEvent = CreateEvent( lpEventAttributes,
- bManualReset, bInitialState, lpName);
+ bManualReset, bInitialState, NULL);
if (hEvent != INVALID_HANDLE_VALUE)
{
@@ -40,8 +39,7 @@ BOOL ResetEventTest()
if (dwRet != WAIT_OBJECT_0)
{
- Fail("ResetEventTest:WaitForSingleObject %s "
- "failed (%x)\n",lpName,GetLastError());
+ Fail("ResetEventTest:WaitForSingleObject failed (%x)\n", GetLastError());
}
else
{
@@ -50,8 +48,7 @@ BOOL ResetEventTest()
if (!bRet)
{
- Fail("ResetEventTest:ResetEvent %s failed "
- "(%x)\n",lpName,GetLastError());
+ Fail("ResetEventTest:ResetEvent failed (%x)\n", GetLastError());
}
else
{
@@ -62,8 +59,7 @@ BOOL ResetEventTest()
if (dwRet != WAIT_TIMEOUT)
{
- Fail("ResetEventTest:WaitForSingleObject "
- "%s failed (%x)\n",lpName,GetLastError());
+ Fail("ResetEventTest:WaitForSingleObject %s failed (%x)\n", GetLastError());
}
else
{
@@ -71,8 +67,7 @@ BOOL ResetEventTest()
if (!bRet)
{
- Fail("ResetEventTest:CloseHandle %s failed"
- "(%x)\n",lpName,GetLastError());
+ Fail("ResetEventTest:CloseHandle failed (%x)\n", GetLastError());
}
}
}
@@ -80,8 +75,7 @@ BOOL ResetEventTest()
}
else
{
- Fail("ResetEventTest:CreateEvent %s failed "
- "(%x)\n",lpName,GetLastError());
+ Fail("ResetEventTest:CreateEvent failed (%x)\n", GetLastError());
}
return bRet;
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.c b/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.c
index f30c24ce70..d7c782b20c 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.c
@@ -33,7 +33,6 @@ int __cdecl main( int argc, char **argv )
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = FALSE;
- LPCTSTR lpName = "HolyMoly";
/* PAL initialization */
@@ -47,7 +46,7 @@ int __cdecl main( int argc, char **argv )
hEvent = CreateEvent( lpEventAttributes,
bManualReset,
bInitialState,
- lpName );
+ NULL );
if( hEvent == INVALID_HANDLE_VALUE )
{
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.c b/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.c
index 8b83faa6df..8d140a7301 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.c
@@ -35,7 +35,6 @@ int __cdecl main( int argc, char **argv )
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = FALSE;
- LPCTSTR lpName = "WooBaby";
/* PAL initialization */
@@ -49,7 +48,7 @@ int __cdecl main( int argc, char **argv )
hEvent = CreateEvent( lpEventAttributes,
bManualReset,
bInitialState,
- lpName );
+ NULL );
if( hEvent == INVALID_HANDLE_VALUE )
{
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.c b/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.c
index 2b6c8bf55a..cff95762d7 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.c
@@ -39,7 +39,6 @@ int __cdecl main( int argc, char **argv )
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = TRUE;
- LPCTSTR lpName = "MamaMia";
/* PAL initialization */
@@ -53,7 +52,7 @@ int __cdecl main( int argc, char **argv )
hEvent = CreateEvent( lpEventAttributes,
bManualReset,
bInitialState,
- lpName );
+ NULL );
if( hEvent == INVALID_HANDLE_VALUE )
{
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test1/test1.c b/src/pal/tests/palsuite/threading/SetEvent/test1/test1.c
index 9df5e0987c..c3a2fd0983 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/SetEvent/test1/test1.c
@@ -24,11 +24,10 @@ BOOL SetEventTest()
LPSECURITY_ATTRIBUTES lpEventAttributes = 0;
BOOL bManualReset = TRUE;
BOOL bInitialState = FALSE;
- LPCTSTR lpName = "Event #3";
/* Create an event which we can use with SetEvent */
HANDLE hEvent = CreateEvent( lpEventAttributes,
- bManualReset, bInitialState, lpName);
+ bManualReset, bInitialState, NULL);
if (hEvent != INVALID_HANDLE_VALUE)
{
@@ -36,8 +35,7 @@ BOOL SetEventTest()
if (dwRet != WAIT_TIMEOUT)
{
- Trace("SetEventTest:WaitForSingleObject %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("SetEventTest:WaitForSingleObject failed (%x)\n", GetLastError());
}
else
{
@@ -48,8 +46,7 @@ BOOL SetEventTest()
if (!bRet)
{
- Trace("SetEventTest:SetEvent %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("SetEventTest:SetEvent failed (%x)\n", GetLastError());
}
else
{
@@ -57,8 +54,7 @@ BOOL SetEventTest()
if (dwRet != WAIT_OBJECT_0)
{
- Trace("SetEventTest:WaitForSingleObject %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("SetEventTest:WaitForSingleObject failed (%x)\n", GetLastError());
}
else
{
@@ -66,8 +62,7 @@ BOOL SetEventTest()
if (!dwRet)
{
- Trace("SetEventTest:CloseHandle %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("SetEventTest:CloseHandle failed (%x)\n", GetLastError());
}
}
}
@@ -75,8 +70,7 @@ BOOL SetEventTest()
}
else
{
- Trace("SetEventTest:CreateEvent %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("SetEventTest:CreateEvent failed (%x)\n", GetLastError());
}
return bRet;
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test2/test2.c b/src/pal/tests/palsuite/threading/SetEvent/test2/test2.c
index df3f064f1d..394c6464c0 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/SetEvent/test2/test2.c
@@ -34,7 +34,6 @@ int __cdecl main( int argc, char **argv )
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = FALSE;
- LPCTSTR lpName = "WooBaby";
/* PAL initialization */
@@ -48,7 +47,7 @@ int __cdecl main( int argc, char **argv )
hEvent = CreateEvent( lpEventAttributes,
bManualReset,
bInitialState,
- lpName );
+ NULL );
if( hEvent == INVALID_HANDLE_VALUE )
{
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test3/test3.c b/src/pal/tests/palsuite/threading/SetEvent/test3/test3.c
index a8c7f80350..8dd6997465 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/SetEvent/test3/test3.c
@@ -34,7 +34,6 @@ int __cdecl main( int argc, char **argv )
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = FALSE;
- LPCTSTR lpName = "WooBaby";
/* PAL initialization */
@@ -48,7 +47,7 @@ int __cdecl main( int argc, char **argv )
hEvent = CreateEvent( lpEventAttributes,
bManualReset,
bInitialState,
- lpName );
+ NULL );
if( hEvent == INVALID_HANDLE_VALUE )
{
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test4/test4.c b/src/pal/tests/palsuite/threading/SetEvent/test4/test4.c
index 39ff419305..4e627ef398 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/SetEvent/test4/test4.c
@@ -39,7 +39,6 @@ int __cdecl main( int argc, char **argv )
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = FALSE;
- LPCTSTR lpName = "OhYeah";
/* PAL initialization */
@@ -53,7 +52,7 @@ int __cdecl main( int argc, char **argv )
hEvent = CreateEvent( lpEventAttributes,
bManualReset,
bInitialState,
- lpName );
+ NULL );
if( hEvent == INVALID_HANDLE_VALUE )
{
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.c
index e5e23d8a2e..ad9bbf6305 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.c
@@ -29,23 +29,18 @@ BOOL WaitForMultipleObjectsTest()
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = TRUE;
- LPTSTR lpName[MAX_EVENTS];
HANDLE hEvent[MAX_EVENTS];
/* Run through this for loop and create 4 events */
for (i = 0; i < MAX_EVENTS; i++)
{
- lpName[i] = (TCHAR*)malloc(MAX_PATH);
- sprintf(lpName[i],"Event #%d",i);
-
hEvent[i] = CreateEvent( lpEventAttributes,
- bManualReset, bInitialState, lpName[i]);
+ bManualReset, bInitialState, NULL);
if (hEvent[i] == INVALID_HANDLE_VALUE)
{
- Trace("WaitForMultipleObjectsTest:CreateEvent "
- "%s failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsTest:CreateEvent %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -55,8 +50,7 @@ BOOL WaitForMultipleObjectsTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsTest:SetEvent %s "
- "failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsTest:SetEvent %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -66,8 +60,7 @@ BOOL WaitForMultipleObjectsTest()
if (dwRet != WAIT_OBJECT_0)
{
- Trace("WaitForMultipleObjectsTest:WaitForSingleObject "
- "%s failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsTest:WaitForSingleObject %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -79,8 +72,7 @@ BOOL WaitForMultipleObjectsTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsTest:ResetEvent %s "
- "failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsTest:ResetEvent %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -89,8 +81,7 @@ BOOL WaitForMultipleObjectsTest()
if (dwRet != WAIT_TIMEOUT)
{
- Trace("WaitForMultipleObjectsTest:WaitForSingleObject "
- "%s failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsTest:WaitForSingleObject %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -117,8 +108,7 @@ BOOL WaitForMultipleObjectsTest()
if (dwRet != WAIT_TIMEOUT)
{
- Trace("WaitForMultipleObjectsTest:WaitForMultipleObjects "
- "%s failed (%x)\n",lpName[0],GetLastError());
+ Trace("WaitForMultipleObjectsTest:WaitForMultipleObjects failed (%x)\n", GetLastError());
}
else
{
@@ -137,9 +127,7 @@ BOOL WaitForMultipleObjectsTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsTest:SetEvent "
- "%s failed (%x)\n",
- lpName[j],GetLastError());
+ Trace("WaitForMultipleObjectsTest:SetEvent %u failed (%x)\n", j, GetLastError());
break;
}
}
@@ -149,9 +137,7 @@ BOOL WaitForMultipleObjectsTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsTest:ResetEvent "
- "%s failed (%x)\n",
- lpName[j],GetLastError());
+ Trace("WaitForMultipleObjectsTest:ResetEvent %u failed (%x)\n", j, GetLastError());
}
}
}
@@ -164,8 +150,7 @@ BOOL WaitForMultipleObjectsTest()
if (dwRet != WAIT_OBJECT_0+i)
{
- Trace("WaitForMultipleObjectsTest:WaitForMultipleObjects"
- " %s failed (%x)\n",lpName[0],GetLastError());
+ Trace("WaitForMultipleObjectsTest:WaitForMultipleObjects failed (%x)\n", GetLastError());
bRet = FALSE;
break;
}
@@ -178,11 +163,8 @@ BOOL WaitForMultipleObjectsTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsTest:CloseHandle %s "
- "failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsTest:CloseHandle %u failed (%x)\n", i, GetLastError());
}
-
- free((void*)lpName[i]);
}
}
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.c
index b762ce4f87..375c85d1a4 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.c
@@ -31,23 +31,18 @@ BOOL WaitForMultipleObjectsExTest()
LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
BOOL bManualReset = TRUE;
BOOL bInitialState = TRUE;
- LPTSTR lpName[MAX_EVENTS];
HANDLE hEvent[MAX_EVENTS];
/* Run through this for loop and create 4 events */
for (i = 0; i < MAX_EVENTS; i++)
{
- lpName[i] = (TCHAR*)malloc(MAX_PATH);
- sprintf(lpName[i],"Event #%d",i);
-
hEvent[i] = CreateEvent( lpEventAttributes,
- bManualReset, bInitialState, lpName[i]);
+ bManualReset, bInitialState, NULL);
if (hEvent[i] == INVALID_HANDLE_VALUE)
{
- Trace("WaitForMultipleObjectsExTest:CreateEvent "
- "%s failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsExTest:CreateEvent %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -57,8 +52,7 @@ BOOL WaitForMultipleObjectsExTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsExTest:SetEvent %s "
- "failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsExTest:SetEvent %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -68,8 +62,7 @@ BOOL WaitForMultipleObjectsExTest()
if (dwRet != WAIT_OBJECT_0)
{
- Trace("WaitForMultipleObjectsExTest:WaitForSingleObject "
- "%s failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsExTest:WaitForSingleObject %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -81,8 +74,7 @@ BOOL WaitForMultipleObjectsExTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsExTest:ResetEvent %s "
- "failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsExTest:ResetEvent %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -91,8 +83,7 @@ BOOL WaitForMultipleObjectsExTest()
if (dwRet != WAIT_TIMEOUT)
{
- Trace("WaitForMultipleObjectsExTest:WaitForSingleObject "
- "%s failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsExTest:WaitForSingleObject %u failed (%x)\n", i, GetLastError());
bRet = FALSE;
break;
}
@@ -120,8 +111,7 @@ BOOL WaitForMultipleObjectsExTest()
if (dwRet != WAIT_TIMEOUT)
{
- Trace("WaitForMultipleObjectsExTest: WaitForMultipleObjectsEx "
- "%s failed (%x)\n",lpName[0],GetLastError());
+ Trace("WaitForMultipleObjectsExTest: WaitForMultipleObjectsEx failed (%x)\n", GetLastError());
}
else
{
@@ -140,9 +130,7 @@ BOOL WaitForMultipleObjectsExTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsExTest:SetEvent "
- "%s failed (%x)\n",
- lpName[j],GetLastError());
+ Trace("WaitForMultipleObjectsExTest:SetEvent %j failed (%x)\n", j, GetLastError());
break;
}
}
@@ -152,9 +140,7 @@ BOOL WaitForMultipleObjectsExTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsExTest:ResetEvent "
- "%s failed (%x)\n",
- lpName[j],GetLastError());
+ Trace("WaitForMultipleObjectsExTest:ResetEvent %u failed (%x)\n", j, GetLastError());
}
}
}
@@ -167,9 +153,7 @@ BOOL WaitForMultipleObjectsExTest()
if (dwRet != WAIT_OBJECT_0+i)
{
- Trace("WaitForMultipleObjectsExTest: "
- "WaitForMultipleObjectsEx %s failed (%x)\n",
- lpName[0],GetLastError());
+ Trace("WaitForMultipleObjectsExTest: WaitForMultipleObjectsEx failed (%x)\n", GetLastError());
bRet = FALSE;
break;
}
@@ -182,11 +166,8 @@ BOOL WaitForMultipleObjectsExTest()
if (!bRet)
{
- Trace("WaitForMultipleObjectsExTest:CloseHandle %s "
- "failed (%x)\n",lpName[i],GetLastError());
+ Trace("WaitForMultipleObjectsExTest:CloseHandle %u failed (%x)\n", i, GetLastError());
}
-
- free((void*)lpName[i]);
}
}
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c
index 5d231cd749..303f9033e6 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c
@@ -60,9 +60,9 @@ int __cdecl main( int argc, char **argv )
*/
/* Create a mutex that is not in the signalled state */
- hMutex = CreateMutex( NULL, //No security attributes
- TRUE, //Iniitally owned
- "SomeMutex"); //Name of mutex
+ hMutex = CreateMutex(NULL, //No security attributes
+ TRUE, //Iniitally owned
+ NULL); //Name of mutex
if (hMutex == NULL)
{
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c
index f28d1a5a00..dff346e70d 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c
@@ -54,10 +54,9 @@ int __cdecl main(int argc, char **argv)
}
//Create Mutex
- hMutex = CreateMutex(
- NULL, // no security attributes
- FALSE, // initially not owned
- "MutexToProtectGlobalCounter"); // name of mutex
+ hMutex = CreateMutex(NULL, // no security attributes
+ FALSE, // initially not owned
+ NULL); // name of mutex
//Check for Mutex Creation
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c
index 7bea24bbd6..bfbebb20c7 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c
@@ -25,13 +25,12 @@ BOOL WaitForSingleObjectTest()
LPSECURITY_ATTRIBUTES lpEventAttributes = 0;
BOOL bManualReset = TRUE;
BOOL bInitialState = TRUE;
- LPCTSTR lpName = "Event #6";
HANDLE hEvent;
/* Create an event, and ensure the HANDLE is valid */
hEvent = CreateEvent(lpEventAttributes, bManualReset,
- bInitialState, lpName);
+ bInitialState, NULL);
if (hEvent != INVALID_HANDLE_VALUE)
{
@@ -44,8 +43,7 @@ BOOL WaitForSingleObjectTest()
if (dwRet != WAIT_OBJECT_0)
{
- Trace("WaitForSingleObjectTest:WaitForSingleObject %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("WaitForSingleObjectTest:WaitForSingleObject failed (%x)\n", GetLastError());
}
else
{
@@ -53,15 +51,13 @@ BOOL WaitForSingleObjectTest()
if (!bRet)
{
- Trace("WaitForSingleObjectTest:CloseHandle %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("WaitForSingleObjectTest:CloseHandle failed (%x)\n", GetLastError());
}
}
}
else
{
- Trace("WaitForSingleObjectTest:CreateEvent %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("WaitForSingleObjectTest:CreateEvent failed (%x)\n", GetLastError());
}
/* If the first section passed, Create another event, with the
@@ -75,7 +71,7 @@ BOOL WaitForSingleObjectTest()
bInitialState = FALSE;
hEvent = CreateEvent( lpEventAttributes,
- bManualReset, bInitialState, lpName);
+ bManualReset, bInitialState, NULL);
if (hEvent != INVALID_HANDLE_VALUE)
{
@@ -88,8 +84,7 @@ BOOL WaitForSingleObjectTest()
if (dwRet != WAIT_TIMEOUT)
{
- Trace("WaitForSingleObjectTest:WaitForSingleObject %s "
- "failed (%x)\n",lpName,GetLastError());
+ Trace("WaitForSingleObjectTest:WaitForSingleObject failed (%x)\n", GetLastError());
}
else
{
@@ -97,15 +92,13 @@ BOOL WaitForSingleObjectTest()
if (!bRet)
{
- Trace("WaitForSingleObjectTest:CloseHandle %s failed "
- "(%x)\n",lpName,GetLastError());
+ Trace("WaitForSingleObjectTest:CloseHandle failed (%x)\n", GetLastError());
}
}
}
else
{
- Trace("WaitForSingleObjectTest::CreateEvent %s failed "
- "(%x)\n",lpName,GetLastError());
+ Trace("WaitForSingleObjectTest::CreateEvent failed (%x)\n", GetLastError());
}
}
return bRet;