Sync with trunk (r48545)
[reactos.git] / dll / win32 / kernel32 / file / mailslot.c
index 1cc68d2..cbc7900 100644 (file)
 /* INCLUDES *****************************************************************/
 
 #include <k32.h>
-#include <wine/debug.h>
-
-WINE_DEFAULT_DEBUG_CHANNEL(kernel32file);
+#define NDEBUG
+#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
 
 /* FUNCTIONS ****************************************************************/
 
 /*
  * @implemented
  */
-HANDLE STDCALL
+HANDLE WINAPI
 CreateMailslotA(LPCSTR lpName,
                DWORD nMaxMessageSize,
                DWORD lReadTimeout,
@@ -47,7 +47,7 @@ CreateMailslotA(LPCSTR lpName,
 /*
  * @implemented
  */
-HANDLE STDCALL
+HANDLE WINAPI
 CreateMailslotW(LPCWSTR lpName,
                DWORD nMaxMessageSize,
                DWORD lReadTimeout,
@@ -109,6 +109,11 @@ CreateMailslotW(LPCWSTR lpName,
                                 nMaxMessageSize,
                                 &DefaultTimeOut);
 
+   if (Status == STATUS_INVALID_DEVICE_REQUEST || Status == STATUS_NOT_SUPPORTED)
+   {
+       Status = STATUS_OBJECT_NAME_INVALID;
+   }
+
    RtlFreeHeap(RtlGetProcessHeap(),
                0,
                MailslotName.Buffer);
@@ -127,7 +132,7 @@ CreateMailslotW(LPCWSTR lpName,
 /*
  * @implemented
  */
-BOOL STDCALL
+BOOL WINAPI
 GetMailslotInfo(HANDLE hMailslot,
                LPDWORD lpMaxMessageSize,
                LPDWORD lpNextSize,
@@ -165,7 +170,7 @@ GetMailslotInfo(HANDLE hMailslot,
    if (lpReadTimeout != NULL)
      {
        if (Buffer.ReadTimeout.LowPart == 0 &&
-           Buffer.ReadTimeout.HighPart == 0x80000000)
+           Buffer.ReadTimeout.HighPart == (LONG)0x80000000)
            *lpReadTimeout = MAILSLOT_WAIT_FOREVER;
        else
            *lpReadTimeout = (DWORD)(Buffer.ReadTimeout.QuadPart / -10000);
@@ -178,7 +183,7 @@ GetMailslotInfo(HANDLE hMailslot,
 /*
  * @implemented
  */
-BOOL STDCALL
+BOOL WINAPI
 SetMailslotInfo(HANDLE hMailslot,
                DWORD lReadTimeout)
 {