ntoskrnl header cleanups
Modified: trunk/reactos/include/ndk/pstypes.h
Modified: trunk/reactos/ntoskrnl/include/internal/ob.h
Modified: trunk/reactos/ntoskrnl/include/internal/po.h
Modified: trunk/reactos/ntoskrnl/include/internal/port.h
Modified: trunk/reactos/ntoskrnl/lpc/port.c
Modified: trunk/reactos/ntoskrnl/ob/handle.c
Modified: trunk/reactos/ntoskrnl/ob/namespc.c
Modified: trunk/reactos/ntoskrnl/ob/object.c
Modified: trunk/reactos/ntoskrnl/ob/sdcache.c
Modified: trunk/reactos/ntoskrnl/ob/symlink.c
Modified: trunk/reactos/ntoskrnl/po/power.c

Modified: trunk/reactos/include/ndk/pstypes.h
--- trunk/reactos/include/ndk/pstypes.h	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/include/ndk/pstypes.h	2005-09-13 23:48:54 UTC (rev 17845)
@@ -499,6 +499,12 @@
     SECURITY_IMPERSONATION_LEVEL    ImpersonationLevel;
 } PS_IMPERSONATION_INFORMATION, *PPS_IMPERSONATION_INFORMATION;
 
+typedef struct _TERMINATION_PORT
+{
+    struct _TERMINATION_PORT *Next;
+    PVOID Port;
+} TERMINATION_PORT, *PTERMINATION_PORT;
+
 #include <pshpack4.h>
 typedef struct _ETHREAD
 {

Modified: trunk/reactos/ntoskrnl/include/internal/ob.h
--- trunk/reactos/ntoskrnl/include/internal/ob.h	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/include/internal/ob.h	2005-09-13 23:48:54 UTC (rev 17845)
@@ -11,42 +11,40 @@
 
 struct _EPROCESS;
 
+#define ICIF_QUERY               0x1
+#define ICIF_SET                 0x2
+#define ICIF_QUERY_SIZE_VARIABLE 0x4
+#define ICIF_SET_SIZE_VARIABLE   0x8
+#define ICIF_SIZE_VARIABLE (ICIF_QUERY_SIZE_VARIABLE | ICIF_SET_SIZE_VARIABLE)
+
 typedef struct _DIRECTORY_OBJECT
 {
-   CSHORT Type;
-   CSHORT Size;
+    CSHORT Type;
+    CSHORT Size;
 
    /*
     * PURPOSE: Head of the list of our subdirectories
     */
-   LIST_ENTRY head;
-   KSPIN_LOCK Lock;
+    LIST_ENTRY head;
+    KSPIN_LOCK Lock;
 } DIRECTORY_OBJECT, *PDIRECTORY_OBJECT;
 
 typedef struct _SYMLINK_OBJECT
 {
-  CSHORT Type;
-  CSHORT Size;
-  UNICODE_STRING TargetName;
-  LARGE_INTEGER CreateTime;
+    CSHORT Type;
+    CSHORT Size;
+    UNICODE_STRING TargetName;
+    LARGE_INTEGER CreateTime;
 } SYMLINK_OBJECT, *PSYMLINK_OBJECT;
 
-/*
- * Enumeration of object types
- */
-enum
+typedef struct _INFORMATION_CLASS_INFO
 {
-   OBJTYP_INVALID,
-   OBJTYP_TYPE,
-   OBJTYP_DIRECTORY,
-   OBJTYP_SYMLNK,
-   OBJTYP_DEVICE,
-   OBJTYP_THREAD,
-   OBJTYP_FILE,
-   OBJTYP_PROCESS,
-   OBJTYP_SECTION,
-   OBJTYP_MAX,
-};
+  ULONG RequiredSizeQUERY;
+  ULONG RequiredSizeSET;
+  ULONG AlignmentSET;
+  ULONG AlignmentQUERY;
+  ULONG Flags;
+} INFORMATION_CLASS_INFO, *PINFORMATION_CLASS_INFO;
 
 #define BODY_TO_HEADER(objbdy)                                                 \
   CONTAINING_RECORD((objbdy), OBJECT_HEADER, Body)
@@ -62,10 +60,6 @@
 
 #define OBJECT_ALLOC_SIZE(ObjectSize) ((ObjectSize)+sizeof(OBJECT_HEADER))
 
-extern PDIRECTORY_OBJECT NameSpaceRoot;
-extern POBJECT_TYPE ObSymbolicLinkType;
-extern PHANDLE_TABLE ObpKernelHandleTable;
-
 #define KERNEL_HANDLE_FLAG (1 << ((sizeof(HANDLE) * 8) - 1))
 #define ObIsKernelHandle(Handle, ProcessorMode)                                \
   (((ULONG_PTR)(Handle) & KERNEL_HANDLE_FLAG) &&                               \
@@ -73,94 +67,152 @@
 #define ObKernelHandleToHandle(Handle)                                         \
   (HANDLE)((ULONG_PTR)(Handle) & ~KERNEL_HANDLE_FLAG)
 
-VOID ObpAddEntryDirectory(PDIRECTORY_OBJECT Parent,
-			  POBJECT_HEADER Header,
-			  PWSTR Name);
-VOID ObpRemoveEntryDirectory(POBJECT_HEADER Header);
+extern PDIRECTORY_OBJECT NameSpaceRoot;
+extern POBJECT_TYPE ObSymbolicLinkType;
+extern PHANDLE_TABLE ObpKernelHandleTable;
 
 VOID
+NTAPI
+ObpAddEntryDirectory(
+    PDIRECTORY_OBJECT Parent,
+    POBJECT_HEADER Header,
+    PWSTR Name
+);
+
+VOID
+NTAPI
+ObpRemoveEntryDirectory(POBJECT_HEADER Header);
+
+VOID
+NTAPI
 ObInitSymbolicLinkImplementation(VOID);
 
+NTSTATUS
+NTAPI
+ObpCreateHandle(
+    struct _EPROCESS* Process,
+    PVOID ObjectBody,
+    ACCESS_MASK GrantedAccess,
+    BOOLEAN Inherit,
+    PHANDLE Handle
+);
 
-NTSTATUS ObpCreateHandle(struct _EPROCESS* Process,
-			PVOID ObjectBody,
-			ACCESS_MASK GrantedAccess,
-			BOOLEAN Inherit,
-			PHANDLE Handle);
-VOID ObCreateHandleTable(struct _EPROCESS* Parent,
-			 BOOLEAN Inherit,
-			 struct _EPROCESS* Process);
-NTSTATUS ObFindObject(POBJECT_CREATE_INFORMATION ObjectCreateInfo,
-            PUNICODE_STRING ObjectName,
-		      PVOID* ReturnedObject,
-		      PUNICODE_STRING RemainingPath,
-		      POBJECT_TYPE ObjectType);
+VOID
+NTAPI
+ObCreateHandleTable(
+    struct _EPROCESS* Parent,
+    BOOLEAN Inherit,
+    struct _EPROCESS* Process
+);
 
 NTSTATUS
-ObpQueryHandleAttributes(HANDLE Handle,
-			 POBJECT_HANDLE_ATTRIBUTE_INFORMATION HandleInfo);
+NTAPI
+ObFindObject(
+    POBJECT_CREATE_INFORMATION ObjectCreateInfo,
+    PUNICODE_STRING ObjectName,
+    PVOID* ReturnedObject,
+    PUNICODE_STRING RemainingPath,
+    POBJECT_TYPE ObjectType
+);
 
 NTSTATUS
-ObpSetHandleAttributes(HANDLE Handle,
-		       POBJECT_HANDLE_ATTRIBUTE_INFORMATION HandleInfo);
+NTAPI
+ObpQueryHandleAttributes(
+    HANDLE Handle,
+    POBJECT_HANDLE_ATTRIBUTE_INFORMATION HandleInfo
+);
 
 NTSTATUS
+NTAPI
+ObpSetHandleAttributes(
+    HANDLE Handle,
+    POBJECT_HANDLE_ATTRIBUTE_INFORMATION HandleInfo
+);
+
+NTSTATUS
 STDCALL
-ObpCreateTypeObject(struct _OBJECT_TYPE_INITIALIZER *ObjectTypeInitializer, 
-                    PUNICODE_STRING TypeName, 
-                    POBJECT_TYPE *ObjectType);
+ObpCreateTypeObject(
+    struct _OBJECT_TYPE_INITIALIZER *ObjectTypeInitializer,
+    PUNICODE_STRING TypeName,
+    POBJECT_TYPE *ObjectType
+);
 
 ULONG
+NTAPI
 ObGetObjectHandleCount(PVOID Object);
+
 NTSTATUS
-ObDuplicateObject(PEPROCESS SourceProcess,
-		  PEPROCESS TargetProcess,
-		  HANDLE SourceHandle,
-		  PHANDLE TargetHandle,
-		  ACCESS_MASK DesiredAccess,
-		  BOOLEAN InheritHandle,
-		  ULONG	Options);
+NTAPI
+ObDuplicateObject(
+    PEPROCESS SourceProcess,
+    PEPROCESS TargetProcess,
+    HANDLE SourceHandle,
+    PHANDLE TargetHandle,
+    ACCESS_MASK DesiredAccess,
+    BOOLEAN InheritHandle,
+    ULONG Options
+);
 
 ULONG
+NTAPI
 ObpGetHandleCountByHandleTable(PHANDLE_TABLE HandleTable);
 
 VOID
 STDCALL
-ObQueryDeviceMapInformation(PEPROCESS Process, PPROCESS_DEVICEMAP_INFORMATION DeviceMapInfo);
+ObQueryDeviceMapInformation(
+    PEPROCESS Process,
+    PPROCESS_DEVICEMAP_INFORMATION DeviceMapInfo
+);
 
-VOID FASTCALL
-ObpSetPermanentObject (IN PVOID ObjectBody, IN BOOLEAN Permanent);
+VOID
+FASTCALL
+ObpSetPermanentObject(
+    IN PVOID ObjectBody,
+    IN BOOLEAN Permanent
+);
 
 VOID
 STDCALL
 ObKillProcess(PEPROCESS Process);
+
 /* Security descriptor cache functions */
 
 NTSTATUS
+NTAPI
 ObpInitSdCache(VOID);
 
 NTSTATUS
-ObpAddSecurityDescriptor(IN PSECURITY_DESCRIPTOR SourceSD,
-			 OUT PSECURITY_DESCRIPTOR *DestinationSD);
+NTAPI
+ObpAddSecurityDescriptor(
+    IN PSECURITY_DESCRIPTOR SourceSD,
+    OUT PSECURITY_DESCRIPTOR *DestinationSD
+);
 
 NTSTATUS
+NTAPI
 ObpRemoveSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor);
 
 VOID
+NTAPI
 ObpReferenceCachedSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor);
 
 VOID
+NTAPI
 ObpDereferenceCachedSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor);
 
 VOID
 FASTCALL
-ObInitializeFastReference(IN PEX_FAST_REF FastRef,
-                          PVOID Object);
+ObInitializeFastReference(
+    IN PEX_FAST_REF FastRef,
+    PVOID Object
+);
 
 PVOID
 FASTCALL
-ObFastReplaceObject(IN PEX_FAST_REF FastRef,
-                    PVOID Object);
+ObFastReplaceObject(
+    IN PEX_FAST_REF FastRef,
+    PVOID Object
+);
 
 PVOID
 FASTCALL
@@ -168,32 +220,30 @@
 
 VOID
 FASTCALL
-ObFastDereferenceObject(IN PEX_FAST_REF FastRef,
-                        PVOID Object);
+ObFastDereferenceObject(
+    IN PEX_FAST_REF FastRef,
+    PVOID Object
+);
 
 /* Secure object information functions */
 
-typedef struct _CAPTURED_OBJECT_ATTRIBUTES
-{
-  HANDLE RootDirectory;
-  ULONG Attributes;
-  PSECURITY_DESCRIPTOR SecurityDescriptor;
-  PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService;
-} CAPTURED_OBJECT_ATTRIBUTES, *PCAPTURED_OBJECT_ATTRIBUTES;
-
 NTSTATUS
 STDCALL
-ObpCaptureObjectName(IN PUNICODE_STRING CapturedName,
-                     IN PUNICODE_STRING ObjectName,
-                     IN KPROCESSOR_MODE AccessMode);
-                     
+ObpCaptureObjectName(
+    IN PUNICODE_STRING CapturedName,
+    IN PUNICODE_STRING ObjectName,
+    IN KPROCESSOR_MODE AccessMode
+);
+
 NTSTATUS
 STDCALL
-ObpCaptureObjectAttributes(IN POBJECT_ATTRIBUTES ObjectAttributes,
-                           IN KPROCESSOR_MODE AccessMode,
-                           IN POBJECT_TYPE ObjectType,
-                           IN POBJECT_CREATE_INFORMATION ObjectCreateInfo,
-                           OUT PUNICODE_STRING ObjectName);
+ObpCaptureObjectAttributes(
+    IN POBJECT_ATTRIBUTES ObjectAttributes,
+    IN KPROCESSOR_MODE AccessMode,
+    IN POBJECT_TYPE ObjectType,
+    IN POBJECT_CREATE_INFORMATION ObjectCreateInfo,
+    OUT PUNICODE_STRING ObjectName
+);
 
 VOID
 STDCALL
@@ -201,21 +251,6 @@
 
 /* object information classes */
 
-#define ICIF_QUERY               0x1
-#define ICIF_SET                 0x2
-#define ICIF_QUERY_SIZE_VARIABLE 0x4
-#define ICIF_SET_SIZE_VARIABLE   0x8
-#define ICIF_SIZE_VARIABLE (ICIF_QUERY_SIZE_VARIABLE | ICIF_SET_SIZE_VARIABLE)
-
-typedef struct _INFORMATION_CLASS_INFO
-{
-  ULONG RequiredSizeQUERY;
-  ULONG RequiredSizeSET;
-  ULONG AlignmentSET;
-  ULONG AlignmentQUERY;
-  ULONG Flags;
-} INFORMATION_CLASS_INFO, *PINFORMATION_CLASS_INFO;
-
 #define ICI_SQ_SAME(Size, Alignment, Flags)                                    \
   { Size, Size, Alignment, Alignment, Flags }
 

Modified: trunk/reactos/ntoskrnl/include/internal/po.h
--- trunk/reactos/ntoskrnl/include/internal/po.h	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/include/internal/po.h	2005-09-13 23:48:54 UTC (rev 17845)
@@ -4,12 +4,14 @@
 extern PDEVICE_NODE PopSystemPowerDeviceNode;
 
 VOID
+NTAPI
 PoInit(
     PLOADER_PARAMETER_BLOCK LoaderBlock, 
     BOOLEAN ForceAcpiDisable
 );
 
 NTSTATUS
+NTAPI
 PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState);
 
 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_PO_H */

Modified: trunk/reactos/ntoskrnl/include/internal/port.h
--- trunk/reactos/ntoskrnl/include/internal/port.h	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/include/internal/port.h	2005-09-13 23:48:54 UTC (rev 17845)
@@ -1,148 +1,160 @@
 #ifndef __INCLUDE_INTERNAL_PORT_H
 #define __INCLUDE_INTERNAL_PORT_H
 
+/* EPORT.Type */
+
+#define EPORT_TYPE_SERVER_RQST_PORT   (0)
+#define EPORT_TYPE_SERVER_COMM_PORT   (1)
+#define EPORT_TYPE_CLIENT_COMM_PORT   (2)
+
+/* EPORT.State */
+
+#define EPORT_INACTIVE                (0)
+#define EPORT_WAIT_FOR_CONNECT        (1)
+#define EPORT_WAIT_FOR_ACCEPT         (2)
+#define EPORT_WAIT_FOR_COMPLETE_SRV   (3)
+#define EPORT_WAIT_FOR_COMPLETE_CLT   (4)
+#define EPORT_CONNECTED_CLIENT        (5)
+#define EPORT_CONNECTED_SERVER        (6)
+#define EPORT_DISCONNECTED            (7)
+
+extern POBJECT_TYPE LpcPortObjectType;
+extern ULONG        LpcpNextMessageId;
+extern FAST_MUTEX   LpcpLock;
+
 typedef struct _EPORT_LISTENER
 {
-  HANDLE ListenerPid;
-  LIST_ENTRY ListenerListEntry;
+    HANDLE ListenerPid;
+    LIST_ENTRY ListenerListEntry;
 } EPORT_LISTENER, *PEPORT_LISTENER;
 
 typedef struct _EPORT
 {
-  KSPIN_LOCK	Lock;
-  KSEMAPHORE    Semaphore;
+    KSPIN_LOCK Lock;
+    KSEMAPHORE Semaphore;
+    USHORT Type;
+    USHORT State;
+    struct _EPORT *RequestPort;
+    struct _EPORT *OtherPort;
+    ULONG QueueLength;
+    LIST_ENTRY QueueListHead;
+    ULONG ConnectQueueLength;
+    LIST_ENTRY ConnectQueueListHead;
+    ULONG MaxDataLength;
+    ULONG MaxConnectInfoLength;
+    ULONG MaxPoolUsage; /* size of NP zone */
+} EPORT, *PEPORT;
 
-  USHORT	Type;
-  USHORT	State;
-
-  struct _EPORT * RequestPort;
-  struct _EPORT	* OtherPort;
-
-  ULONG		QueueLength;
-  LIST_ENTRY	QueueListHead;
-
-  ULONG		ConnectQueueLength;
-  LIST_ENTRY	ConnectQueueListHead;
-
-  ULONG		MaxDataLength;
-  ULONG		MaxConnectInfoLength;
-  ULONG		MaxPoolUsage; /* size of NP zone */
-} EPORT, * PEPORT;
-
 typedef struct _EPORT_CONNECT_REQUEST_MESSAGE
 {
-  PORT_MESSAGE MessageHeader;
-  PEPROCESS ConnectingProcess;
-  struct _SECTION_OBJECT* SendSectionObject;
-  LARGE_INTEGER SendSectionOffset;
-  ULONG SendViewSize;
-  ULONG ConnectDataLength;
-  UCHAR ConnectData[0];
+    PORT_MESSAGE MessageHeader;
+    PEPROCESS ConnectingProcess;
+    struct _SECTION_OBJECT* SendSectionObject;
+    LARGE_INTEGER SendSectionOffset;
+    ULONG SendViewSize;
+    ULONG ConnectDataLength;
+    UCHAR ConnectData[0];
 } EPORT_CONNECT_REQUEST_MESSAGE, *PEPORT_CONNECT_REQUEST_MESSAGE;
 
 typedef struct _EPORT_CONNECT_REPLY_MESSAGE
 {
-  PORT_MESSAGE MessageHeader;
-  PVOID SendServerViewBase;
-  ULONG ReceiveClientViewSize;
-  PVOID ReceiveClientViewBase;
-  ULONG MaximumMessageSize;
-  ULONG ConnectDataLength;
-  UCHAR ConnectData[0];
+    PORT_MESSAGE MessageHeader;
+    PVOID SendServerViewBase;
+    ULONG ReceiveClientViewSize;
+    PVOID ReceiveClientViewBase;
+    ULONG MaximumMessageSize;
+    ULONG ConnectDataLength;
+    UCHAR ConnectData[0];
 } EPORT_CONNECT_REPLY_MESSAGE, *PEPORT_CONNECT_REPLY_MESSAGE;
 
-typedef struct _TERMINATION_PORT {
-    struct _TERMINATION_PORT *Next;
-    PVOID Port;
-} TERMINATION_PORT, *PTERMINATION_PORT;
+typedef struct _QUEUEDMESSAGE
+{
+    PEPORT Sender;
+    LIST_ENTRY QueueListEntry;
+    PORT_MESSAGE Message;
+} QUEUEDMESSAGE, *PQUEUEDMESSAGE;
 
-NTSTATUS STDCALL
-LpcRequestPort (PEPORT		Port,
-		PPORT_MESSAGE	LpcMessage);
 NTSTATUS
 STDCALL
-LpcSendTerminationPort (PEPORT	Port,
-			LARGE_INTEGER	CreationTime);
+LpcRequestPort(
+    PEPORT Port,
+    PPORT_MESSAGE LpcMessage
+);
 
-/* EPORT.Type */
+NTSTATUS
+STDCALL
+LpcSendTerminationPort(
+    PEPORT Port,
+    LARGE_INTEGER CreationTime
+);
 
-#define EPORT_TYPE_SERVER_RQST_PORT   (0)
-#define EPORT_TYPE_SERVER_COMM_PORT   (1)
-#define EPORT_TYPE_CLIENT_COMM_PORT   (2)
+/* Code in ntoskrnl/lpc/close.h */
 
-/* EPORT.State */
+VOID 
+STDCALL
+LpcpClosePort(
+    PVOID ObjectBody,
+    ULONG HandleCount
+);
 
-#define EPORT_INACTIVE                (0)
-#define EPORT_WAIT_FOR_CONNECT        (1)
-#define EPORT_WAIT_FOR_ACCEPT         (2)
-#define EPORT_WAIT_FOR_COMPLETE_SRV   (3)
-#define EPORT_WAIT_FOR_COMPLETE_CLT   (4)
-#define EPORT_CONNECTED_CLIENT        (5)
-#define EPORT_CONNECTED_SERVER        (6)
-#define EPORT_DISCONNECTED            (7)
+VOID
+STDCALL
+LpcpDeletePort(IN PVOID ObjectBody);
 
-/* Pool Tags */
+/* Code in ntoskrnl/lpc/queue.c */
 
-typedef struct _QUEUEDMESSAGE
-{
-  PEPORT		Sender;
-  LIST_ENTRY	QueueListEntry;
-  PORT_MESSAGE	Message;
-} QUEUEDMESSAGE,  *PQUEUEDMESSAGE;
+VOID
+STDCALL
+EiEnqueueConnectMessagePort(
+    IN OUT PEPORT Port,
+    IN PQUEUEDMESSAGE Message
+);
 
-/* Code in ntoskrnl/lpc/close.h */
+VOID
+STDCALL
+EiEnqueueMessagePort(
+    IN OUT PEPORT Port,
+    IN PQUEUEDMESSAGE Message
+);
 
-VOID STDCALL
-LpcpClosePort (PVOID	ObjectBody,
-	     ULONG	HandleCount);
-VOID STDCALL
-LpcpDeletePort (IN	PVOID	ObjectBody);
+VOID
+STDCALL
+EiEnqueueMessageAtHeadPort(
+    IN OUT PEPORT Port,
+    IN PQUEUEDMESSAGE Message
+);
 
-/* Code in ntoskrnl/lpc/queue.c */
+PQUEUEDMESSAGE
+STDCALL
+EiDequeueConnectMessagePort(IN OUT PEPORT Port);
 
-VOID STDCALL
-EiEnqueueConnectMessagePort (IN OUT	PEPORT		Port,
-			     IN	PQUEUEDMESSAGE	Message);
-VOID STDCALL
-EiEnqueueMessagePort (IN OUT	PEPORT		Port,
-		      IN	PQUEUEDMESSAGE	Message);
-VOID STDCALL
-EiEnqueueMessageAtHeadPort (IN OUT	PEPORT		Port,
-			    IN	PQUEUEDMESSAGE	Message);
 PQUEUEDMESSAGE
 STDCALL
-EiDequeueConnectMessagePort (IN OUT	PEPORT	Port);
-PQUEUEDMESSAGE STDCALL
-EiDequeueMessagePort (IN OUT	PEPORT	Port);
+EiDequeueMessagePort(IN OUT PEPORT Port);
 
-/* Code in ntoskrnl/lpc/create.c */
-
-NTSTATUS STDCALL
-NiCreatePort (PVOID			ObjectBody,
-	      PVOID			Parent,
-	      PWSTR			RemainingPath,
-	      POBJECT_ATTRIBUTES	ObjectAttributes);
-
 /* Code in ntoskrnl/lpc/port.c */
 
-NTSTATUS STDCALL
-LpcpInitializePort (IN OUT  PEPORT	Port,
-		  IN      USHORT        Type,
-		  IN      PEPORT        Parent OPTIONAL);
 NTSTATUS
+STDCALL
+LpcpInitializePort(
+    IN OUT PEPORT Port,
+    IN USHORT Type,
+    IN PEPORT Parent OPTIONAL
+);
+
+NTSTATUS
+NTAPI
 LpcpInitSystem (VOID);
 
-extern POBJECT_TYPE	LpcPortObjectType;
-extern ULONG		LpcpNextMessageId;
-extern FAST_MUTEX	LpcpLock;
-
 /* Code in ntoskrnl/lpc/reply.c */
 
-NTSTATUS STDCALL
-EiReplyOrRequestPort (IN	PEPORT		Port,
-		      IN	PPORT_MESSAGE	LpcReply,
-		      IN	ULONG		MessageType,
-		      IN	PEPORT		Sender);
+NTSTATUS
+STDCALL
+EiReplyOrRequestPort(
+    IN PEPORT Port,
+    IN PPORT_MESSAGE LpcReply,
+    IN ULONG MessageType,
+    IN PEPORT Sender
+);
 
-
 #endif /* __INCLUDE_INTERNAL_PORT_H */

Modified: trunk/reactos/ntoskrnl/lpc/port.c
--- trunk/reactos/ntoskrnl/lpc/port.c	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/lpc/port.c	2005-09-13 23:48:54 UTC (rev 17845)
@@ -32,7 +32,9 @@
 /* FUNCTIONS *****************************************************************/
 
 
-NTSTATUS INIT_FUNCTION
+NTSTATUS
+INIT_FUNCTION
+NTAPI
 LpcpInitSystem (VOID)
 {
     OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;

Modified: trunk/reactos/ntoskrnl/ob/handle.c
--- trunk/reactos/ntoskrnl/ob/handle.c	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/ob/handle.c	2005-09-13 23:48:54 UTC (rev 17845)
@@ -85,6 +85,7 @@
 
 
 NTSTATUS
+NTAPI
 ObpQueryHandleAttributes(HANDLE Handle,
 			 POBJECT_HANDLE_ATTRIBUTE_INFORMATION HandleInfo)
 {
@@ -128,6 +129,7 @@
 
 
 NTSTATUS
+NTAPI
 ObpSetHandleAttributes(HANDLE Handle,
 		       POBJECT_HANDLE_ATTRIBUTE_INFORMATION HandleInfo)
 {
@@ -227,6 +229,7 @@
 
 
 NTSTATUS
+NTAPI
 ObDuplicateObject(PEPROCESS SourceProcess,
 		  PEPROCESS TargetProcess,
 		  HANDLE SourceHandle,
@@ -540,7 +543,9 @@
   return Ret;
 }
 
-VOID ObCreateHandleTable(PEPROCESS Parent,
+VOID
+NTAPI
+ObCreateHandleTable(PEPROCESS Parent,
 			 BOOLEAN Inherit,
 			 PEPROCESS Process)
 /*
@@ -582,6 +587,7 @@
 
 
 NTSTATUS
+NTAPI
 ObpCreateHandle(PEPROCESS Process,
 	       PVOID ObjectBody,
 	       ACCESS_MASK GrantedAccess,
@@ -1139,6 +1145,7 @@
 
 
 ULONG
+NTAPI
 ObpGetHandleCountByHandleTable(PHANDLE_TABLE HandleTable)
 {
   return HandleTable->HandleCount;

Modified: trunk/reactos/ntoskrnl/ob/namespc.c
--- trunk/reactos/ntoskrnl/ob/namespc.c	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/ob/namespc.c	2005-09-13 23:48:54 UTC (rev 17845)
@@ -239,6 +239,7 @@
 }
 
 VOID
+NTAPI
 ObpAddEntryDirectory(PDIRECTORY_OBJECT Parent,
 		     POBJECT_HEADER Header,
 		     PWSTR Name)
@@ -262,6 +263,7 @@
 
 
 VOID
+NTAPI
 ObpRemoveEntryDirectory(POBJECT_HEADER Header)
 /*
  * FUNCTION: Remove an entry from a namespace directory

Modified: trunk/reactos/ntoskrnl/ob/object.c
--- trunk/reactos/ntoskrnl/ob/object.c	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/ob/object.c	2005-09-13 23:48:54 UTC (rev 17845)
@@ -288,6 +288,7 @@
  * RETURN VALUE
  */
 NTSTATUS
+NTAPI
 ObFindObject(POBJECT_CREATE_INFORMATION ObjectCreateInfo,
             PUNICODE_STRING ObjectName,
 	     PVOID* ReturnedObject,
@@ -1247,6 +1248,7 @@
  * 	Reference count.
  */
 ULONG
+NTAPI
 ObGetObjectHandleCount(PVOID Object)
 {
   POBJECT_HEADER Header;

Modified: trunk/reactos/ntoskrnl/ob/sdcache.c
--- trunk/reactos/ntoskrnl/ob/sdcache.c	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/ob/sdcache.c	2005-09-13 23:48:54 UTC (rev 17845)
@@ -36,6 +36,7 @@
 /* FUNCTIONS ****************************************************************/
 
 NTSTATUS
+NTAPI
 ObpInitSdCache(VOID)
 {
   ULONG i;
@@ -207,6 +208,7 @@
 
 
 NTSTATUS
+NTAPI
 ObpAddSecurityDescriptor(IN PSECURITY_DESCRIPTOR SourceSD,
 			 OUT PSECURITY_DESCRIPTOR *DestinationSD)
 {
@@ -277,6 +279,7 @@
 
 
 NTSTATUS
+NTAPI
 ObpRemoveSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
 {
   PSD_CACHE_ENTRY CacheEntry;
@@ -305,6 +308,7 @@
 
 
 VOID
+NTAPI
 ObpReferenceCachedSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
 {
   PSD_CACHE_ENTRY CacheEntry;
@@ -325,6 +329,7 @@
 
 
 VOID
+NTAPI
 ObpDereferenceCachedSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
 {
   DPRINT("ObpDereferenceCachedSecurityDescriptor() called\n");

Modified: trunk/reactos/ntoskrnl/ob/symlink.c
--- trunk/reactos/ntoskrnl/ob/symlink.c	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/ob/symlink.c	2005-09-13 23:48:54 UTC (rev 17845)
@@ -131,6 +131,7 @@
  */
 VOID 
 INIT_FUNCTION
+NTAPI
 ObInitSymbolicLinkImplementation (VOID)
 {
   UNICODE_STRING Name;

Modified: trunk/reactos/ntoskrnl/po/power.c
--- trunk/reactos/ntoskrnl/po/power.c	2005-09-13 23:28:21 UTC (rev 17844)
+++ trunk/reactos/ntoskrnl/po/power.c	2005-09-13 23:48:54 UTC (rev 17845)
@@ -229,6 +229,7 @@
 }
 
 NTSTATUS
+NTAPI
 PopSetSystemPowerState(
   SYSTEM_POWER_STATE PowerState)
 {
@@ -291,6 +292,7 @@
 
 VOID
 INIT_FUNCTION
+NTAPI
 PoInit(PLOADER_PARAMETER_BLOCK LoaderBlock,
        BOOLEAN ForceAcpiDisable)
 {