SM - clean, simplify, make more readable
[reactos.git] / reactos / subsys / smss / debug.c
1 /* $Id: smss.c 12852 2005-01-06 13:58:04Z mf $
2 *
3 * debug.c - Session Manager debug messages switch and router
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 * 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 #define NTOS_MODE_USER
27 #include <ntos.h>
28 #include <rosrtl/string.h>
29 #include <sm/api.h>
30 #include "smss.h"
31
32 /* GLOBALS ***********************************************************/
33
34 HANDLE DbgSsApiPort = INVALID_HANDLE_VALUE;
35 HANDLE DbgUiApiPort = INVALID_HANDLE_VALUE;
36
37 /* FUNCTIONS *********************************************************/
38
39 NTSTATUS
40 SmInitializeDbgSs (VOID)
41 {
42 NTSTATUS Status;
43 UNICODE_STRING UnicodeString;
44 OBJECT_ATTRIBUTES ObjectAttributes;
45
46
47 /* Create the \DbgSsApiPort object (LPC) */
48 RtlRosInitUnicodeStringFromLiteral(&UnicodeString,
49 L"\\DbgSsApiPort");
50 InitializeObjectAttributes(&ObjectAttributes,
51 &UnicodeString,
52 PORT_ALL_ACCESS,
53 NULL,
54 NULL);
55
56 Status = NtCreatePort(&DbgSsApiPort,
57 &ObjectAttributes,
58 0,
59 0,
60 0);
61
62 if (!NT_SUCCESS(Status))
63 {
64 return(Status);
65 }
66 DbgPrint("SMSS: %s: \\DbgSsApiPort created\n",__FUNCTION__);
67
68 /* Create the \DbgUiApiPort object (LPC) */
69 RtlRosInitUnicodeStringFromLiteral(&UnicodeString,
70 L"\\DbgUiApiPort");
71 InitializeObjectAttributes(&ObjectAttributes,
72 &UnicodeString,
73 PORT_ALL_ACCESS,
74 NULL,
75 NULL);
76
77 Status = NtCreatePort(&DbgUiApiPort,
78 &ObjectAttributes,
79 0,
80 0,
81 0);
82 if (!NT_SUCCESS(Status))
83 {
84 return(Status);
85 }
86 DbgPrint("SMSS: %s: \\DbgUiApiPort created\n",__FUNCTION__);
87
88 return STATUS_SUCCESS;
89 }
90
91 /* EOF */
92