ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

server.h
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS Native Headers
00003  * FILE:            include/subsys/csr/server.h
00004  * PURPOSE:         Public Definitions for CSR Servers
00005  * PROGRAMMER:      Alex Ionescu (alex@relsoft.net)
00006  */
00007 #ifndef _CSRSERVER_H
00008 #define _CSRSERVER_H
00009 
00010 #ifdef _MSC_VER
00011 #pragma warning(push)
00012 #pragma warning (disable:4201)
00013 #endif
00014 
00015 /* DEPENDENCIES **************************************************************/
00016 
00017 /* TYPES **********************************************************************/
00018 typedef struct _CSR_NT_SESSION
00019 {
00020     ULONG ReferenceCount;
00021     LIST_ENTRY SessionLink;
00022     ULONG SessionId;
00023 } CSR_NT_SESSION, *PCSR_NT_SESSION;
00024 
00025 typedef struct _CSR_PROCESS
00026 {
00027     CLIENT_ID ClientId;
00028     LIST_ENTRY ListLink;
00029     LIST_ENTRY ThreadList;
00030     struct _CSR_PROCESS *Parent;
00031     PCSR_NT_SESSION NtSession;
00032     ULONG ExpectedVersion;
00033     HANDLE ClientPort;
00034     ULONG_PTR ClientViewBase;
00035     ULONG_PTR ClientViewBounds;
00036     HANDLE ProcessHandle;
00037     ULONG SequenceNumber;
00038     ULONG Flags;
00039     ULONG DebugFlags;
00040     CLIENT_ID DebugCid;
00041     ULONG ReferenceCount;
00042     ULONG ProcessGroupId;
00043     ULONG ProcessGroupSequence;
00044     ULONG fVDM;
00045     ULONG ThreadCount;
00046     ULONG PriorityClass;
00047     ULONG Reserved;
00048     ULONG ShutdownLevel;
00049     ULONG ShutdownFlags;
00050     PVOID ServerData[ANYSIZE_ARRAY];
00051 } CSR_PROCESS, *PCSR_PROCESS;
00052 
00053 typedef struct _CSR_THREAD
00054 {
00055     LARGE_INTEGER CreateTime;
00056     LIST_ENTRY Link;
00057     LIST_ENTRY HashLinks;
00058     CLIENT_ID ClientId;
00059     PCSR_PROCESS Process;
00060     struct _CSR_WAIT_BLOCK *WaitBlock;
00061     HANDLE ThreadHandle;
00062     ULONG Flags;
00063     ULONG ReferenceCount;
00064     ULONG ImpersonationCount;
00065 } CSR_THREAD, *PCSR_THREAD;
00066 
00067 /* ENUMERATIONS **************************************************************/
00068 #define CSR_SRV_SERVER 0
00069 
00070 typedef enum _CSR_PROCESS_FLAGS
00071 {
00072     CsrProcessTerminating = 0x1,
00073     CsrProcessSkipShutdown = 0x2,
00074     CsrProcessNormalPriority = 0x10,
00075     CsrProcessIdlePriority = 0x20,
00076     CsrProcessHighPriority = 0x40,
00077     CsrProcessRealtimePriority = 0x80,
00078     CsrProcessCreateNewGroup = 0x100,
00079     CsrProcessTerminated = 0x200,
00080     CsrProcessLastThreadTerminated = 0x400,
00081     CsrProcessIsConsoleApp = 0x800
00082 } CSR_PROCESS_FLAGS, *PCSR_PROCESS_FLAGS;
00083 
00084 #define CsrProcessPriorityFlags (CsrProcessNormalPriority | \
00085                                  CsrProcessIdlePriority | \
00086                                  CsrProcessHighPriority | \
00087                                  CsrProcessRealtimePriority)
00088 
00089 typedef enum _CSR_THREAD_FLAGS
00090 {
00091     CsrThreadAltertable = 0x1,
00092     CsrThreadInTermination = 0x2,
00093     CsrThreadTerminated = 0x4,
00094     CsrThreadIsServerThread = 0x10
00095 } CSR_THREAD_FLAGS, *PCSR_THREAD_FLAGS;
00096 
00097 typedef enum _SHUTDOWN_RESULT
00098 {
00099     CsrShutdownCsrProcess = 1,
00100     CsrShutdownNonCsrProcess,
00101     CsrShutdownCancelled
00102 } SHUTDOWN_RESULT, *PSHUTDOWN_RESULT;
00103 
00104 typedef enum _CSR_SHUTDOWN_FLAGS
00105 {
00106     CsrShutdownSystem = 4,
00107     CsrShutdownOther = 8
00108 } CSR_SHUTDOWN_FLAGS, *PCSR_SHUTDOWN_FLAGS;
00109 
00110 typedef enum _CSR_DEBUG_FLAGS
00111 {
00112     CsrDebugOnlyThisProcess = 1,
00113     CsrDebugProcessChildren = 2
00114 } CSR_PROCESS_DEBUG_FLAGS, *PCSR_PROCESS_DEBUG_FLAGS;
00115 
00116 /* FUNCTION TYPES ************************************************************/
00117 typedef
00118 NTSTATUS
00119 (NTAPI *PCSR_CONNECT_CALLBACK)(
00120     IN PCSR_PROCESS CsrProcess,
00121     IN OUT PVOID ConnectionInfo,
00122     IN OUT PULONG ConnectionInfoLength
00123 );
00124 
00125 typedef
00126 VOID
00127 (NTAPI *PCSR_DISCONNECT_CALLBACK)(IN PCSR_PROCESS CsrProcess);
00128 
00129 typedef
00130 NTSTATUS
00131 (NTAPI *PCSR_NEWPROCESS_CALLBACK)(
00132     IN PCSR_PROCESS Parent,
00133     IN PCSR_PROCESS CsrProcess
00134 );
00135 
00136 typedef
00137 VOID
00138 (NTAPI *PCSR_HARDERROR_CALLBACK)(
00139     IN PCSR_THREAD CsrThread,
00140     IN PHARDERROR_MSG HardErrorMessage
00141 );
00142 
00143 typedef
00144 ULONG
00145 (NTAPI *PCSR_SHUTDOWNPROCESS_CALLBACK)(
00146     IN PCSR_PROCESS CsrProcess,
00147     IN ULONG Flags,
00148     IN BOOLEAN FirstPhase
00149 );
00150 
00151 
00152 /* FIXME: Put into public NDK Header */
00153 typedef ULONG CSR_API_NUMBER;
00154 
00155 #define CSR_MAKE_OPCODE(s,m) ((s) << 16) | (m)
00156 #define CSR_API_ID_FROM_OPCODE(n) ((ULONG)((USHORT)(n)))
00157 #define CSR_SERVER_ID_FROM_OPCODE(n) (ULONG)((n) >> 16)
00158 
00159 typedef struct _CSR_CONNECTION_INFO
00160 {
00161     ULONG Unknown[2];
00162     HANDLE ObjectDirectory;
00163     PVOID SharedSectionBase;
00164     PVOID SharedSectionHeap;
00165     PVOID SharedSectionData;
00166     ULONG DebugFlags;
00167     ULONG Unknown2[3];
00168     HANDLE ProcessId;
00169 } CSR_CONNECTION_INFO, *PCSR_CONNECTION_INFO;
00170 
00171 typedef struct _CSR_CLIENT_CONNECT
00172 {
00173     ULONG ServerId;
00174     PVOID ConnectionInfo;
00175     ULONG ConnectionInfoSize;
00176 } CSR_CLIENT_CONNECT, *PCSR_CLIENT_CONNECT;
00177 
00178 typedef struct _CSR_API_MESSAGE
00179 {
00180     PORT_MESSAGE Header;
00181     union
00182     {
00183         CSR_CONNECTION_INFO ConnectionInfo;
00184         struct
00185         {
00186             PVOID CsrCaptureData;
00187             CSR_API_NUMBER Opcode;
00188             ULONG Status;
00189             ULONG Reserved;
00190             union
00191             {
00192                 CSR_CLIENT_CONNECT CsrClientConnect;
00193             };
00194         };
00195     };
00196 } CSR_API_MESSAGE, *PCSR_API_MESSAGE;
00197 
00198 typedef struct _CSR_CAPTURE_BUFFER
00199 {
00200     ULONG Size;
00201     struct _CSR_CAPTURE_BUFFER *PreviousCaptureBuffer;
00202     ULONG PointerCount;
00203     ULONG_PTR BufferEnd;
00204 } CSR_CAPTURE_BUFFER, *PCSR_CAPTURE_BUFFER;
00205 
00206 /* Private data resumes here */
00207 typedef
00208 NTSTATUS
00209 (NTAPI *PCSR_API_ROUTINE)(
00210     IN OUT PCSR_API_MESSAGE ApiMessage,
00211     IN OUT PULONG Reply
00212 );
00213 
00214 typedef struct _CSR_SERVER_DLL
00215 {
00216     ULONG Length;
00217     HANDLE Event;
00218     ANSI_STRING Name;
00219     HANDLE ServerHandle;
00220     ULONG ServerId;
00221     ULONG Unknown;
00222     ULONG ApiBase;
00223     ULONG HighestApiSupported;
00224     PCSR_API_ROUTINE *DispatchTable;
00225     PBOOLEAN ValidTable;
00226     PCHAR *NameTable;
00227     ULONG SizeOfProcessData;
00228     PCSR_CONNECT_CALLBACK ConnectCallback;
00229     PCSR_DISCONNECT_CALLBACK DisconnectCallback;
00230     PCSR_HARDERROR_CALLBACK HardErrorCallback;
00231     PVOID SharedSection;
00232     PCSR_NEWPROCESS_CALLBACK NewProcessCallback;
00233     PCSR_SHUTDOWNPROCESS_CALLBACK ShutdownProcessCallback;
00234     ULONG Unknown2[3];
00235 } CSR_SERVER_DLL, *PCSR_SERVER_DLL;
00236 
00237 typedef
00238 NTSTATUS
00239 (NTAPI *PCSR_SERVER_DLL_INIT_CALLBACK)(IN PCSR_SERVER_DLL ServerDll);
00240 
00241 typedef
00242 BOOLEAN
00243 (*CSR_WAIT_FUNCTION)(
00244     IN PLIST_ENTRY WaitList,
00245     IN PCSR_THREAD WaitThread,
00246     IN PCSR_API_MESSAGE WaitApiMessage,
00247     IN PVOID WaitContext,
00248     IN PVOID WaitArgument1,
00249     IN PVOID WaitArgument2,
00250     IN ULONG WaitFlags
00251 );
00252 
00253 typedef struct _CSR_WAIT_BLOCK
00254 {
00255     ULONG Size;
00256     LIST_ENTRY WaitList;
00257     LIST_ENTRY UserWaitList;
00258     PVOID WaitContext;
00259     PCSR_THREAD WaitThread;
00260     CSR_WAIT_FUNCTION WaitFunction;
00261     CSR_API_MESSAGE WaitApiMessage;
00262 } CSR_WAIT_BLOCK, *PCSR_WAIT_BLOCK;
00263 
00264 /* PROTOTYPES ****************************************************************/
00265 
00266 NTSTATUS
00267 NTAPI
00268 CsrServerInitialization(
00269     ULONG ArgumentCount,
00270     PCHAR Arguments[]
00271 );
00272 
00273 #ifdef _MSC_VER
00274 #pragma warning(pop)
00275 #endif
00276 
00277 #endif

Generated on Sat May 26 2012 04:32:06 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.