Commit 9d5ddd25 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

kernel32/tests: Fix mailslot tests compilation with __WINESRC__ defined.

parent a897e13f
......@@ -42,24 +42,24 @@ static int mailslot_test(void)
&dwMsgCount, &dwTimeout ), "getmailslotinfo succeeded\n");
/* open a mailslot that doesn't exist */
hWriter = CreateFile(szmspath, GENERIC_READ|GENERIC_WRITE,
hWriter = CreateFileA(szmspath, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
ok( hWriter == INVALID_HANDLE_VALUE, "nonexistent mailslot\n");
/* open a mailslot without the right name */
hSlot = CreateMailslot( "blah", 0, 0, NULL );
hSlot = CreateMailslotA( "blah", 0, 0, NULL );
ok( hSlot == INVALID_HANDLE_VALUE,
"Created mailslot with invalid name\n");
ok( GetLastError() == ERROR_INVALID_NAME,
"error should be ERROR_INVALID_NAME\n");
/* open a mailslot with a null name */
hSlot = CreateMailslot( NULL, 0, 0, NULL );
hSlot = CreateMailslotA( NULL, 0, 0, NULL );
ok( hSlot == INVALID_HANDLE_VALUE, "Created mailslot with invalid name\n");
ok( GetLastError() == ERROR_PATH_NOT_FOUND, "error should be ERROR_PATH_NOT_FOUND\n");
/* valid open, but with wacky parameters ... then check them */
hSlot = CreateMailslot( szmspath, -1, -1, NULL );
hSlot = CreateMailslotA( szmspath, -1, -1, NULL );
ok( hSlot != INVALID_HANDLE_VALUE , "mailslot with valid name failed\n");
dwMax = dwNext = dwMsgCount = dwTimeout = 0;
ok( GetMailslotInfo( hSlot, &dwMax, &dwNext, &dwMsgCount, &dwTimeout ),
......@@ -73,7 +73,7 @@ static int mailslot_test(void)
ok( CloseHandle(hSlot), "failed to close mailslot\n");
/* now open it for real */
hSlot = CreateMailslot( szmspath, 0, 0, NULL );
hSlot = CreateMailslotA( szmspath, 0, 0, NULL );
ok( hSlot != INVALID_HANDLE_VALUE , "valid mailslot failed\n");
/* try and read/write to it */
......@@ -103,14 +103,14 @@ todo_wine
ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
/* now try and open the client, but with the wrong sharing mode */
hWriter = CreateFile(szmspath, GENERIC_WRITE,
hWriter = CreateFileA(szmspath, GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL);
ok( hWriter != INVALID_HANDLE_VALUE /* vista */ || GetLastError() == ERROR_SHARING_VIOLATION,
"error should be ERROR_SHARING_VIOLATION got %p / %u\n", hWriter, GetLastError());
if (hWriter != INVALID_HANDLE_VALUE) CloseHandle( hWriter );
/* now open the client with the correct sharing mode */
hWriter = CreateFile(szmspath, GENERIC_READ|GENERIC_WRITE,
hWriter = CreateFileA(szmspath, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %u\n", GetLastError());
......@@ -156,25 +156,25 @@ todo_wine
else ok( count == 0, "wrong count %u\n", count );
/* now try open another writer... should fail */
hWriter2 = CreateFile(szmspath, GENERIC_READ|GENERIC_WRITE,
hWriter2 = CreateFileA(szmspath, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
/* succeeds on vista, don't test */
if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 );
/* now try open another as a reader ... also fails */
hWriter2 = CreateFile(szmspath, GENERIC_READ,
hWriter2 = CreateFileA(szmspath, GENERIC_READ,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
/* succeeds on vista, don't test */
if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 );
/* now try open another as a writer ... still fails */
hWriter2 = CreateFile(szmspath, GENERIC_WRITE,
hWriter2 = CreateFileA(szmspath, GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
/* succeeds on vista, don't test */
if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 );
/* now open another one */
hSlot2 = CreateMailslot( szmspath, 0, 0, NULL );
hSlot2 = CreateMailslotA( szmspath, 0, 0, NULL );
ok( hSlot2 == INVALID_HANDLE_VALUE , "opened two mailslots\n");
/* close the client again */
......@@ -184,7 +184,7 @@ todo_wine
* now try reopen it with slightly different permissions ...
* shared writing
*/
hWriter = CreateFile(szmspath, GENERIC_WRITE,
hWriter = CreateFileA(szmspath, GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
ok( hWriter != INVALID_HANDLE_VALUE, "sharing writer\n");
......@@ -192,13 +192,13 @@ todo_wine
* now try open another as a writer ...
* but don't share with the first ... fail
*/
hWriter2 = CreateFile(szmspath, GENERIC_WRITE,
hWriter2 = CreateFileA(szmspath, GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
/* succeeds on vista, don't test */
if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 );
/* now try open another as a writer ... and share with the first */
hWriter2 = CreateFile(szmspath, GENERIC_WRITE,
hWriter2 = CreateFileA(szmspath, GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
ok( hWriter2 != INVALID_HANDLE_VALUE, "2nd sharing writer\n");
......@@ -316,7 +316,7 @@ todo_wine
ok( CloseHandle( hSlot ), "closing the mailslot\n");
/* test timeouts */
hSlot = CreateMailslot( szmspath, 0, 1000, NULL );
hSlot = CreateMailslotA( szmspath, 0, 1000, NULL );
ok( hSlot != INVALID_HANDLE_VALUE , "valid mailslot failed\n");
count = 0;
memset(buffer, 0, sizeof buffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment