6ccaa24ac3675c9de9ffac5d7ad6d18e42d49c1b
[reactos.git] / reactos / subsys / csr / csrsrv / process.c
1 /* $Id$
2 *
3 * subsys/csr/csrsrv/process.c - CSR server - process management
4 *
5 * ReactOS Operating System
6 *
7 * --------------------------------------------------------------------
8 *
9 * This software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This software is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this software; see the file COPYING.LIB. If not, write
21 * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
22 * MA 02139, USA.
23 *
24 * --------------------------------------------------------------------
25 */
26 #include "srv.h"
27
28 //#define NDEBUG
29 #include <debug.h>
30
31 /* LOCALS */
32
33 struct {
34 RTL_CRITICAL_SECTION Lock;
35 } Process;
36
37
38
39 NTSTATUS STDCALL CsrSrvInitializeProcess (VOID)
40 {
41 NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
42
43 DPRINT("CSRSRV: %s called\n", __FUNCTION__);
44
45 Status = RtlInitializeCriticalSection (& Process.Lock);
46 if(NT_SUCCESS(Status))
47 {
48 // more process management initialization
49 }
50 return Status;
51 }
52
53 /*=====================================================================
54 * PUBLIC API
55 *===================================================================*/
56
57 NTSTATUS STDCALL CsrCreateProcess (PCSR_SESSION pCsrSession, PCSR_PROCESS * ppCsrProcess)
58 {
59 NTSTATUS Status = STATUS_SUCCESS;
60 PCSR_PROCESS pCsrProcess = NULL;
61
62 DPRINT("CSRSRV: %s called\n", __FUNCTION__);
63
64 pCsrProcess = RtlAllocateHeap (pCsrSession->Heap,
65 HEAP_ZERO_MEMORY,
66 sizeof (CSR_PROCESS));
67 if (NULL == pCsrProcess)
68 {
69 Status = STATUS_NO_MEMORY;
70 } else {
71 pCsrProcess->CsrSession = pCsrSession;
72 if (NULL != ppCsrProcess)
73 {
74 *ppCsrProcess = pCsrProcess;
75 }
76 }
77 return Status;
78 }
79
80 NTSTATUS STDCALL CsrDereferenceProcess (PCSR_PROCESS pCsrProcess)
81 {
82 NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
83
84 DPRINT("CSRSRV: %s called\n", __FUNCTION__);
85 return Status;
86 }
87
88 NTSTATUS STDCALL CsrDestroyProcess (PCSR_PROCESS pCsrProcess)
89 {
90 NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
91
92 DPRINT("CSRSRV: %s called\n", __FUNCTION__);
93 return Status;
94 }
95
96 NTSTATUS STDCALL CsrGetProcessLuid (PCSR_PROCESS pCsrProcess, PLUID pLuid)
97 {
98 NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
99
100 DPRINT("CSRSRV: %s called\n", __FUNCTION__);
101 return Status;
102 }
103
104 NTSTATUS STDCALL CsrLockProcessByClientId ()
105 {
106 NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
107
108 DPRINT("CSRSRV: %s called\n", __FUNCTION__);
109 return Status;
110 }
111
112 NTSTATUS STDCALL CsrShutdownProcesses (PCSR_SESSION pCsrSession OPTIONAL)
113 {
114 NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
115
116 DPRINT("CSRSRV: %s called\n", __FUNCTION__);
117
118 if (NULL == pCsrSession)
119 {
120 // TODO: shutdown every session
121 } else {
122 // TODO: shutdown every process in pCsrSession
123 }
124 return Status;
125 }
126
127 NTSTATUS STDCALL CsrUnlockProcess (PCSR_PROCESS pCsrProcess)
128 {
129 NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
130
131 DPRINT("CSRSRV: %s called\n", __FUNCTION__);
132 return Status;
133 }
134
135 /* EOF */