SM & SMDLL definitions
authorEmanuele Aliberti <ea@iol.it>
Sun, 6 Feb 2005 16:59:55 +0000 (16:59 +0000)
committerEmanuele Aliberti <ea@iol.it>
Sun, 6 Feb 2005 16:59:55 +0000 (16:59 +0000)
svn path=/trunk/; revision=13442

reactos/include/sm/api.h [new file with mode: 0644]
reactos/include/sm/helper.h [new file with mode: 0644]

diff --git a/reactos/include/sm/api.h b/reactos/include/sm/api.h
new file mode 100644 (file)
index 0000000..17bf653
--- /dev/null
@@ -0,0 +1,72 @@
+/* $Id$ */\r
+#ifndef __SM_API_H\r
+#define __SM_API_H\r
+\r
+#define SM_API_PORT_NAME   L"\\SmApiPort"\r
+#define SM_DBGSS_PORT_NAME L"\\DbgSsApiPort"\r
+#define SM_DBGUI_PORT_NAME L"\\DbgUiApiPort"\r
+\r
+#pragma pack(push,4)\r
+\r
+/*** 1 ****************************************************************/\r
+\r
+#define SM_API_COMPLETE_SESSION        1       /* complete a session initialization */\r
+\r
+typedef struct _SM_PORT_MESSAGE_COMPSES\r
+{\r
+       HANDLE  hApiPort;\r
+       HANDLE  hSbApiPort;\r
+\r
+} SM_PORT_MESSAGE_COMPSES, *PSM_PORT_MESSAGE_COMPSES;\r
+\r
+/*** 2 ****************************************************************/\r
+\r
+#define SM_API_2 2\r
+\r
+/* obsolete */\r
+\r
+/*** 3 ****************************************************************/\r
+\r
+#define SM_API_3 3\r
+\r
+/* unknown */\r
+\r
+/*** 4 ****************************************************************/\r
+\r
+#define SM_API_EXECUTE_PROGRAMME       4       /* start a subsystem (server) */\r
+\r
+#define SM_EXEXPGM_MAX_LENGTH  32              /* max count of wide string */\r
+\r
+typedef struct _SM_PORT_MESSAGE_EXECPGM\r
+{\r
+  ULONG  NameLength;\r
+  WCHAR  Name [SM_EXEXPGM_MAX_LENGTH];\r
+\r
+} SM_PORT_MESSAGE_EXECPGM, *PSM_PORT_MESSAGE_EXECPGM;\r
+\r
+/*** | ****************************************************************/\r
+\r
+typedef struct _SM_PORT_MESSAGE\r
+{\r
+  /*** LPC common header ***/\r
+  LPC_MESSAGE Header;\r
+  /*** SM common header ***/\r
+  DWORD       ApiIndex;\r
+  NTSTATUS    Status;\r
+  /*** SM per API arguments ***/\r
+  union {\r
+    SM_PORT_MESSAGE_COMPSES      CompSes;\r
+    SM_PORT_MESSAGE_EXECPGM      ExecPgm;\r
+  };\r
+\r
+} SM_PORT_MESSAGE, * PSM_PORT_MESSAGE;\r
+\r
+#pragma pack(pop)\r
+\r
+/*** MACRO ***********************************************************/\r
+\r
+#define SM_PORT_DATA_SIZE(c)  (sizeof(DWORD)+sizeof(NTSTATUS)+sizeof(c))\r
+#define SM_PORT_MESSAGE_SIZE  (sizeof(SM_PORT_MESSAGE))\r
+\r
+\r
+#endif /* !def __SM_API_H */\r
diff --git a/reactos/include/sm/helper.h b/reactos/include/sm/helper.h
new file mode 100644 (file)
index 0000000..c18dde3
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef _SM_HELPER_H\r
+\r
+/*** DATA TYPES ******************************************************/\r
+\r
+#define SM_SB_NAME_MAX_LENGTH 120\r
+\r
+#pragma pack(push,4)\r
+\r
+/* SmConnectApiPort */\r
+typedef struct _SM_CONNECT_DATA\r
+{\r
+  ULONG  Subsystem;\r
+  WCHAR  SbName [SM_SB_NAME_MAX_LENGTH];\r
+\r
+} SM_CONNECT_DATA, *PSM_CONNECT_DATA;\r
+\r
+/* SmpConnectSbApiPort */\r
+typedef struct _SB_CONNECT_DATA\r
+{\r
+  ULONG SmApiMax;\r
+} SB_CONNECT_DATA, *PSB_CONNECT_DATA;\r
+\r
+#pragma pack(pop)\r
+\r
+\r
+/*** PROTOTYPES ******************************************************/\r
+\r
+\r
+/* smdll/connect.c */\r
+NTSTATUS STDCALL\r
+SmConnectApiPort (IN      PUNICODE_STRING  pSbApiPortName  OPTIONAL,\r
+                 IN      HANDLE           hSbApiPort      OPTIONAL,\r
+                 IN      DWORD            dwSubsystem     OPTIONAL, /* pe.h */\r
+                 IN OUT  PHANDLE          phSmApiPort);\r
+/* smdll/compses.c */\r
+NTSTATUS STDCALL\r
+SmCompleteSession (IN     HANDLE  hSmApiPort,\r
+                  IN     HANDLE  hSbApiPort,\r
+                  IN     HANDLE  hApiPort);\r
+/* smdll/execpgm.c */\r
+NTSTATUS STDCALL\r
+SmExecuteProgram (IN     HANDLE           hSmApiPort,\r
+                 IN     PUNICODE_STRING  Pgm\r
+                 );\r
+\r
+#endif /* ndef _SM_HELPER_H */\r