From e0d93266302e107fae9003be262aabe443519521 Mon Sep 17 00:00:00 2001 From: Emanuele Aliberti Date: Sun, 6 Feb 2005 16:59:55 +0000 Subject: [PATCH 1/1] SM & SMDLL definitions svn path=/trunk/; revision=13442 --- reactos/include/sm/api.h | 72 +++++++++++++++++++++++++++++++++++++ reactos/include/sm/helper.h | 46 ++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 reactos/include/sm/api.h create mode 100644 reactos/include/sm/helper.h diff --git a/reactos/include/sm/api.h b/reactos/include/sm/api.h new file mode 100644 index 00000000000..17bf653dcb8 --- /dev/null +++ b/reactos/include/sm/api.h @@ -0,0 +1,72 @@ +/* $Id$ */ +#ifndef __SM_API_H +#define __SM_API_H + +#define SM_API_PORT_NAME L"\\SmApiPort" +#define SM_DBGSS_PORT_NAME L"\\DbgSsApiPort" +#define SM_DBGUI_PORT_NAME L"\\DbgUiApiPort" + +#pragma pack(push,4) + +/*** 1 ****************************************************************/ + +#define SM_API_COMPLETE_SESSION 1 /* complete a session initialization */ + +typedef struct _SM_PORT_MESSAGE_COMPSES +{ + HANDLE hApiPort; + HANDLE hSbApiPort; + +} SM_PORT_MESSAGE_COMPSES, *PSM_PORT_MESSAGE_COMPSES; + +/*** 2 ****************************************************************/ + +#define SM_API_2 2 + +/* obsolete */ + +/*** 3 ****************************************************************/ + +#define SM_API_3 3 + +/* unknown */ + +/*** 4 ****************************************************************/ + +#define SM_API_EXECUTE_PROGRAMME 4 /* start a subsystem (server) */ + +#define SM_EXEXPGM_MAX_LENGTH 32 /* max count of wide string */ + +typedef struct _SM_PORT_MESSAGE_EXECPGM +{ + ULONG NameLength; + WCHAR Name [SM_EXEXPGM_MAX_LENGTH]; + +} SM_PORT_MESSAGE_EXECPGM, *PSM_PORT_MESSAGE_EXECPGM; + +/*** | ****************************************************************/ + +typedef struct _SM_PORT_MESSAGE +{ + /*** LPC common header ***/ + LPC_MESSAGE Header; + /*** SM common header ***/ + DWORD ApiIndex; + NTSTATUS Status; + /*** SM per API arguments ***/ + union { + SM_PORT_MESSAGE_COMPSES CompSes; + SM_PORT_MESSAGE_EXECPGM ExecPgm; + }; + +} SM_PORT_MESSAGE, * PSM_PORT_MESSAGE; + +#pragma pack(pop) + +/*** MACRO ***********************************************************/ + +#define SM_PORT_DATA_SIZE(c) (sizeof(DWORD)+sizeof(NTSTATUS)+sizeof(c)) +#define SM_PORT_MESSAGE_SIZE (sizeof(SM_PORT_MESSAGE)) + + +#endif /* !def __SM_API_H */ diff --git a/reactos/include/sm/helper.h b/reactos/include/sm/helper.h new file mode 100644 index 00000000000..c18dde35043 --- /dev/null +++ b/reactos/include/sm/helper.h @@ -0,0 +1,46 @@ +#ifndef _SM_HELPER_H + +/*** DATA TYPES ******************************************************/ + +#define SM_SB_NAME_MAX_LENGTH 120 + +#pragma pack(push,4) + +/* SmConnectApiPort */ +typedef struct _SM_CONNECT_DATA +{ + ULONG Subsystem; + WCHAR SbName [SM_SB_NAME_MAX_LENGTH]; + +} SM_CONNECT_DATA, *PSM_CONNECT_DATA; + +/* SmpConnectSbApiPort */ +typedef struct _SB_CONNECT_DATA +{ + ULONG SmApiMax; +} SB_CONNECT_DATA, *PSB_CONNECT_DATA; + +#pragma pack(pop) + + +/*** PROTOTYPES ******************************************************/ + + +/* smdll/connect.c */ +NTSTATUS STDCALL +SmConnectApiPort (IN PUNICODE_STRING pSbApiPortName OPTIONAL, + IN HANDLE hSbApiPort OPTIONAL, + IN DWORD dwSubsystem OPTIONAL, /* pe.h */ + IN OUT PHANDLE phSmApiPort); +/* smdll/compses.c */ +NTSTATUS STDCALL +SmCompleteSession (IN HANDLE hSmApiPort, + IN HANDLE hSbApiPort, + IN HANDLE hApiPort); +/* smdll/execpgm.c */ +NTSTATUS STDCALL +SmExecuteProgram (IN HANDLE hSmApiPort, + IN PUNICODE_STRING Pgm + ); + +#endif /* ndef _SM_HELPER_H */ -- 2.17.1