- DBGKD_WAIT_STATE_CHANGE64 is used in KD protocol 5, not number 6 that we use. Proto...
[reactos.git] / reactos / lib / smlib / execpgm.c
index 288a78e..169f5e7 100644 (file)
@@ -5,10 +5,7 @@
  * FILE:            lib/smlib/execpgm.c
  * PURPOSE:         Call SM API SM_API_EXECPGM
  */
-#define NTOS_MODE_USER
-#include <ntos.h>
-#include <sm/helper.h>
-#include <string.h>
+#include "precomp.h"
 
 #define NDEBUG
 #include <debug.h>
  *                 lookup the image name from the registry).
  *                 Valid names are: DEBUG, WINDOWS, POSIX, OS2,
  *                 and VMS.
- *     
+ *
  * RETURN VALUE
  *     Success status as handed by the SM reply; otherwise a failure
  *     status code.
  */
-NTSTATUS STDCALL
+NTSTATUS WINAPI
 SmExecuteProgram (IN HANDLE          hSmApiPort,
                  IN PUNICODE_STRING Pgm)
 {
@@ -54,28 +51,28 @@ SmExecuteProgram (IN HANDLE          hSmApiPort,
   RtlCopyMemory (SmReqMsg.Request.ExecPgm.Name,
                 Pgm->Buffer,
                 Pgm->Length);
-               
+
   /* SM API to invoke */
   SmReqMsg.SmHeader.ApiIndex = SM_API_EXECUTE_PROGRAMME;
 
   /* LPC message */
-  SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE;
-  SmReqMsg.Header.DataSize    = SM_PORT_DATA_SIZE(SmReqMsg.Request);
-  SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE;
+  SmReqMsg.Header.u2.s2.Type = LPC_NEW_MESSAGE;
+  SmReqMsg.Header.u1.s1.DataLength    = SM_PORT_DATA_SIZE(SmReqMsg.Request);
+  SmReqMsg.Header.u1.s1.TotalLength = SM_PORT_MESSAGE_SIZE;
 
   DPRINT("SMLIB: %s:\n"
-         "  MessageType = %d\n"
-         "  DataSize    = %d\n"
-         "  MessageSize = %d\n"
-         "  sizeof(LPC_MESSAGE)==%d\n",
+         "  u2.s2.Type = %d\n"
+         "  u1.s1.DataLength    = %d\n"
+         "  u1.s1.TotalLength = %d\n"
+         "  sizeof(PORT_MESSAGE)==%d\n",
          __FUNCTION__,
-         SmReqMsg.Header.MessageType,
-         SmReqMsg.Header.DataSize,
-         SmReqMsg.Header.MessageSize,
-         sizeof(LPC_MESSAGE));
+         SmReqMsg.Header.u2.s2.Type,
+         SmReqMsg.Header.u1.s1.DataLength,
+         SmReqMsg.Header.u1.s1.TotalLength,
+         sizeof(PORT_MESSAGE));
 
   /* Call SM and wait for a reply */
-  Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg);
+  Status = NtRequestWaitReplyPort (hSmApiPort, (PPORT_MESSAGE) & SmReqMsg, (PPORT_MESSAGE) & SmReqMsg);
   if (NT_SUCCESS(Status))
   {
     return SmReqMsg.SmHeader.Status;