[NTOS:LPC]: Fix the function prototypes (reference: Process Hacker + how the paramete...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 7 Nov 2016 01:06:24 +0000 (01:06 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 7 Nov 2016 01:06:24 +0000 (01:06 +0000)
[NOTS][NDK]: Fix whitespace in header files.
[XDK]: Define PORT_MAXIMUM_MESSAGE_LENGTH before actually using it in the different IO_ERROR_LOG_xxx #defines, for consistency purposes.

svn path=/trunk/; revision=73163

reactos/ntoskrnl/include/internal/io_x.h
reactos/ntoskrnl/lpc/complete.c
reactos/ntoskrnl/lpc/connect.c
reactos/sdk/include/ndk/iotypes.h
reactos/sdk/include/ndk/lpcfuncs.h
reactos/sdk/include/xdk/iotypes.h

index 93aeb1a..7e0d028 100644 (file)
@@ -11,7 +11,7 @@ __inline
 VOID
 IopLockFileObject(IN PFILE_OBJECT FileObject)
 {
-       /* Lock the FO and check for contention */
+    /* Lock the FO and check for contention */
     InterlockedIncrement((PLONG)&FileObject->Waiters);
     while (InterlockedCompareExchange((PLONG)&FileObject->Busy, TRUE, FALSE) != FALSE)
     {
index ac71133..4bf8edd 100644 (file)
@@ -41,8 +41,8 @@ NtAcceptConnectPort(OUT PHANDLE PortHandle,
                     IN PVOID PortContext OPTIONAL,
                     IN PPORT_MESSAGE ReplyMessage,
                     IN BOOLEAN AcceptConnection,
-                    IN PPORT_VIEW ServerView,
-                    IN PREMOTE_PORT_VIEW ClientView)
+                    IN OUT PPORT_VIEW ServerView OPTIONAL,
+                    OUT PREMOTE_PORT_VIEW ClientView OPTIONAL)
 {
     NTSTATUS Status;
     KPROCESSOR_MODE PreviousMode = KeGetPreviousMode();
index b81afbd..3620c56 100644 (file)
@@ -79,7 +79,7 @@ NTSTATUS
 NTAPI
 NtSecureConnectPort(OUT PHANDLE PortHandle,
                     IN PUNICODE_STRING PortName,
-                    IN PSECURITY_QUALITY_OF_SERVICE Qos,
+                    IN PSECURITY_QUALITY_OF_SERVICE SecurityQos,
                     IN OUT PPORT_VIEW ClientView OPTIONAL,
                     IN PSID ServerSid OPTIONAL,
                     IN OUT PREMOTE_PORT_VIEW ServerView OPTIONAL,
@@ -103,9 +103,9 @@ NtSecureConnectPort(OUT PHANDLE PortHandle,
 
     PAGED_CODE();
     LPCTRACE(LPC_CONNECT_DEBUG,
-             "Name: %wZ. Qos: %p. Views: %p/%p. Sid: %p\n",
+             "Name: %wZ. SecurityQos: %p. Views: %p/%p. Sid: %p\n",
              PortName,
-             Qos,
+             SecurityQos,
              ClientView,
              ServerView,
              ServerSid);
@@ -588,17 +588,17 @@ NTSTATUS
 NTAPI
 NtConnectPort(OUT PHANDLE PortHandle,
               IN PUNICODE_STRING PortName,
-              IN PSECURITY_QUALITY_OF_SERVICE Qos,
-              IN PPORT_VIEW ClientView,
-              IN PREMOTE_PORT_VIEW ServerView,
-              OUT PULONG MaxMessageLength,
-              IN PVOID ConnectionInformation,
-              OUT PULONG ConnectionInformationLength)
+              IN PSECURITY_QUALITY_OF_SERVICE SecurityQos,
+              IN OUT PPORT_VIEW ClientView OPTIONAL,
+              IN OUT PREMOTE_PORT_VIEW ServerView OPTIONAL,
+              OUT PULONG MaxMessageLength OPTIONAL,
+              IN OUT PVOID ConnectionInformation OPTIONAL,
+              IN OUT PULONG ConnectionInformationLength OPTIONAL)
 {
     /* Call the newer API */
     return NtSecureConnectPort(PortHandle,
                                PortName,
-                               Qos,
+                               SecurityQos,
                                ClientView,
                                NULL,
                                ServerView,
index 97fa35f..6bea8fc 100644 (file)
@@ -722,7 +722,7 @@ typedef struct _IO_ERROR_LOG_PACKET
     ULONG IoControlCode;
     LARGE_INTEGER DeviceOffset;
     ULONG DumpData[1];
-}IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET;
+} IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET;
 
 typedef struct _IO_ERROR_LOG_MESSAGE
 {
index 120e763..ffa0962 100644 (file)
@@ -56,8 +56,8 @@ NtAcceptConnectPort(
     _In_opt_ PVOID PortContext,
     _In_ PPORT_MESSAGE ConnectionRequest,
     _In_ BOOLEAN AcceptConnection,
-    _In_opt_ PPORT_VIEW ServerView,
-    _In_opt_ PREMOTE_PORT_VIEW ClientView
+    _Inout_opt_ PPORT_VIEW ServerView,
+    _Out_opt_ PREMOTE_PORT_VIEW ClientView
 );
 
 NTSYSCALLAPI
@@ -74,11 +74,11 @@ NtConnectPort(
     _Out_ PHANDLE PortHandle,
     _In_ PUNICODE_STRING PortName,
     _In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos,
-    _In_opt_ PPORT_VIEW ClientView,
-    _In_opt_ PREMOTE_PORT_VIEW ServerView,
-    _In_opt_ PULONG MaxMessageLength,
-    _In_opt_ PVOID ConnectionInformation,
-    _In_opt_ PULONG ConnectionInformationLength
+    _Inout_opt_ PPORT_VIEW ClientView,
+    _Inout_opt_ PREMOTE_PORT_VIEW ServerView,
+    _Out_opt_ PULONG MaxMessageLength,
+    _Inout_opt_ PVOID ConnectionInformation,
+    _Inout_opt_ PULONG ConnectionInformationLength
 );
 
 NTSYSCALLAPI
@@ -209,12 +209,12 @@ NtSecureConnectPort(
     _Out_ PHANDLE PortHandle,
     _In_ PUNICODE_STRING PortName,
     _In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos,
-    _In_opt_ PPORT_VIEW ClientView,
-    _In_opt_ PSID Sid,
-    _In_opt_ PREMOTE_PORT_VIEW ServerView,
-    _In_opt_ PULONG MaxMessageLength,
-    _In_opt_ PVOID ConnectionInformation,
-    _Out_opt_ PULONG ConnectionInformationLength
+    _Inout_opt_ PPORT_VIEW ClientView,
+    _In_opt_ PSID ServerSid,
+    _Inout_opt_ PREMOTE_PORT_VIEW ServerView,
+    _Out_opt_ PULONG MaxMessageLength,
+    _Inout_opt_ PVOID ConnectionInformation,
+    _Inout_opt_ PULONG ConnectionInformationLength
 );
 
 NTSYSCALLAPI
index 6449a6a..fc97aec 100644 (file)
@@ -1973,6 +1973,13 @@ typedef struct _IO_ERROR_LOG_MESSAGE {
   IO_ERROR_LOG_PACKET EntryData;
 } IO_ERROR_LOG_MESSAGE, *PIO_ERROR_LOG_MESSAGE;
 
+/* See ndk/lpctypes.h */
+#ifdef _WIN64
+#define PORT_MAXIMUM_MESSAGE_LENGTH 512
+#else
+#define PORT_MAXIMUM_MESSAGE_LENGTH 256
+#endif
+
 #define ERROR_LOG_LIMIT_SIZE               240
 #define IO_ERROR_LOG_MESSAGE_HEADER_LENGTH (sizeof(IO_ERROR_LOG_MESSAGE) - \
                                             sizeof(IO_ERROR_LOG_PACKET) + \
@@ -1986,12 +1993,6 @@ typedef struct _IO_ERROR_LOG_MESSAGE {
 #define ERROR_LOG_MAXIMUM_SIZE (IO_ERROR_LOG_MESSAGE_LENGTH -                 \
                                 IO_ERROR_LOG_MESSAGE_HEADER_LENGTH)
 
-#ifdef _WIN64
-#define PORT_MAXIMUM_MESSAGE_LENGTH    512
-#else
-#define PORT_MAXIMUM_MESSAGE_LENGTH    256
-#endif
-
 typedef enum _DMA_WIDTH {
   Width8Bits,
   Width16Bits,