185
186
/***********************************************************************
188
* This is called before the process heap is created,
189
* but after the connection to the server is established.
190
* No windows heap allocation is permitted.
192
static DWORD get_global_flag(void)
194
static const WCHAR sessionman_keyW[] = {'M','a','c','h','i','n','e','\\',
195
'S','y','s','t','e','m','\\',
196
'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
197
'C','o','n','t','r','o','l','\\',
198
'S','e','s','s','i','o','n',' ','M','a','n','a','g','e','r',0};
199
static const WCHAR global_flagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
200
OBJECT_ATTRIBUTES attr;
201
UNICODE_STRING nameW, valueW;
205
KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)tmp;
208
attr.Length = sizeof(attr);
209
attr.RootDirectory = 0;
210
attr.ObjectName = &nameW;
212
attr.SecurityDescriptor = NULL;
213
attr.SecurityQualityOfService = NULL;
214
RtlInitUnicodeString( &nameW, sessionman_keyW );
216
status = NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr );
217
if (status != STATUS_SUCCESS)
220
RtlInitUnicodeString( &valueW, global_flagW );
221
status = NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count );
222
if (status != STATUS_SUCCESS)
225
/* Some documents say this can be a string, so handle either type */
226
if (info->Type == REG_DWORD)
227
return *(DWORD *)info->Data;
228
if (info->Type == REG_SZ)
229
return strtol((char *)info->Data, NULL, 16);
233
/***********************************************************************
236
189
* Setup the initial thread.