Updated debug channels.
[wine] / dlls / ntdll / nt.c
1 /*
2  * NT basis DLL
3  * 
4  * This file contains the Nt* API functions of NTDLL.DLL.
5  * In the original ntdll.dll they all seem to just call int 0x2e (down to the NTOSKRNL)
6  *
7  * Copyright 1996-1998 Marcus Meissner
8  */
9
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 #include <time.h>
14 #include "debugtools.h"
15
16 #include "ntddk.h"
17 #include "ntdll_misc.h"
18 #include "wine/server.h"
19
20 DEFAULT_DEBUG_CHANNEL(ntdll);
21
22 /*
23  *      Timer object
24  */
25  
26 /**************************************************************************
27  *              NtCreateTimer                           [NTDLL.@]
28  *              ZwCreateTimer                           [NTDLL.@]
29  */
30 NTSTATUS WINAPI NtCreateTimer(
31         OUT PHANDLE TimerHandle,
32         IN ACCESS_MASK DesiredAccess,
33         IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
34         IN TIMER_TYPE TimerType)
35 {
36         FIXME("(%p,0x%08lx,%p,0x%08x) stub\n",
37         TimerHandle,DesiredAccess,ObjectAttributes, TimerType);
38         dump_ObjectAttributes(ObjectAttributes);
39         return 0;
40 }
41 /**************************************************************************
42  *              NtSetTimer                              [NTDLL.@]
43  *              ZwSetTimer                              [NTDLL.@]
44  */
45 NTSTATUS WINAPI NtSetTimer(
46         IN HANDLE TimerHandle,
47         IN PLARGE_INTEGER DueTime,
48         IN PTIMERAPCROUTINE TimerApcRoutine,
49         IN PVOID TimerContext,
50         IN BOOLEAN WakeTimer,
51         IN ULONG Period OPTIONAL,
52         OUT PBOOLEAN PreviousState OPTIONAL)
53 {
54         FIXME("(0x%08x,%p,%p,%p,%08x,0x%08lx,%p) stub\n",
55         TimerHandle,DueTime,TimerApcRoutine,TimerContext,WakeTimer,Period,PreviousState);
56         return 0;
57 }
58
59 /******************************************************************************
60  * NtQueryTimerResolution [NTDLL.@]
61  */
62 NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3) 
63 {
64         FIXME("(0x%08lx,0x%08lx,0x%08lx), stub!\n",x1,x2,x3);
65         return 1;
66 }
67
68 /*
69  *      Process object
70  */
71
72 /******************************************************************************
73  *  NtTerminateProcess                  [NTDLL.@]
74  *
75  *  Native applications must kill themselves when done
76  */
77 NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
78 {
79     NTSTATUS ret;
80     BOOL self;
81     SERVER_START_REQ( terminate_process )
82     {
83         req->handle    = handle;
84         req->exit_code = exit_code;
85         ret = wine_server_call( req );
86         self = !ret && reply->self;
87     }
88     SERVER_END_REQ;
89     if (self) exit( exit_code );
90     return ret;
91 }
92
93 /******************************************************************************
94 *  NtQueryInformationProcess            [NTDLL.@]
95 *  ZwQueryInformationProcess            [NTDLL.@]
96 *
97 */
98 NTSTATUS WINAPI NtQueryInformationProcess(
99         IN HANDLE ProcessHandle,
100         IN PROCESSINFOCLASS ProcessInformationClass,
101         OUT PVOID ProcessInformation,
102         IN ULONG ProcessInformationLength,
103         OUT PULONG ReturnLength)
104 {
105         FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
106                 ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength,ReturnLength
107         );
108         /* "These are not the debuggers you are looking for." */
109         if (ProcessInformationClass == ProcessDebugPort)
110             /* set it to 0 aka "no debugger" to satisfy copy protections */
111             memset(ProcessInformation,0,ProcessInformationLength);
112
113         return 0;
114 }
115
116 /******************************************************************************
117  * NtSetInformationProcess [NTDLL.@]
118  * ZwSetInformationProcess [NTDLL.@]
119  */
120 NTSTATUS WINAPI NtSetInformationProcess(
121         IN HANDLE ProcessHandle,
122         IN PROCESSINFOCLASS ProcessInformationClass,
123         IN PVOID ProcessInformation,
124         IN ULONG ProcessInformationLength)
125 {
126         FIXME("(0x%08x,0x%08x,%p,0x%08lx) stub\n",
127         ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength);
128         return 0;
129 }
130
131 /*
132  *      Thread
133  */
134
135 /******************************************************************************
136  *  NtResumeThread      [NTDLL.@]
137  *  ZwResumeThread      [NTDLL.@]
138  */
139 NTSTATUS WINAPI NtResumeThread(
140         IN HANDLE ThreadHandle,
141         IN PULONG SuspendCount) 
142 {
143         FIXME("(0x%08x,%p),stub!\n",
144         ThreadHandle,SuspendCount);
145         return 0;
146 }
147
148
149 /******************************************************************************
150  *  NtTerminateThread   [NTDLL.@]
151  *  ZwTerminateThread   [NTDLL.@]
152  */
153 NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code )
154 {
155     NTSTATUS ret;
156     BOOL self, last;
157
158     SERVER_START_REQ( terminate_thread )
159     {
160         req->handle    = handle;
161         req->exit_code = exit_code;
162         ret = wine_server_call( req );
163         self = !ret && reply->self;
164         last = reply->last;
165     }
166     SERVER_END_REQ;
167
168     if (self)
169     {
170         if (last) exit( exit_code );
171         else SYSDEPS_ExitThread( exit_code );
172     }
173     return ret;
174 }
175
176
177 /******************************************************************************
178 *  NtQueryInformationThread             [NTDLL.@]
179 *  ZwQueryInformationThread             [NTDLL.@]
180 *
181 */
182 NTSTATUS WINAPI NtQueryInformationThread(
183         IN HANDLE ThreadHandle,
184         IN THREADINFOCLASS ThreadInformationClass,
185         OUT PVOID ThreadInformation,
186         IN ULONG ThreadInformationLength,
187         OUT PULONG ReturnLength)
188 {
189         FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
190                 ThreadHandle, ThreadInformationClass, ThreadInformation,
191                 ThreadInformationLength, ReturnLength);
192         return 0;
193 }
194
195 /******************************************************************************
196  *  NtSetInformationThread              [NTDLL.@]
197  *  ZwSetInformationThread              [NTDLL.@]
198  */
199 NTSTATUS WINAPI NtSetInformationThread(
200         HANDLE ThreadHandle,
201         THREADINFOCLASS ThreadInformationClass,
202         PVOID ThreadInformation,
203         ULONG ThreadInformationLength)
204 {
205         FIXME("(0x%08x,0x%08x,%p,0x%08lx),stub!\n",
206         ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength);
207         return 0;
208 }
209
210 /*
211  *      Token
212  */
213
214 /******************************************************************************
215  *  NtDuplicateToken            [NTDLL.@]
216  *  ZwDuplicateToken            [NTDLL.@]
217  */
218 NTSTATUS WINAPI NtDuplicateToken(
219         IN HANDLE ExistingToken,
220         IN ACCESS_MASK DesiredAccess,
221         IN POBJECT_ATTRIBUTES ObjectAttributes,
222         IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
223         IN TOKEN_TYPE TokenType,
224         OUT PHANDLE NewToken)
225 {
226         FIXME("(0x%08x,0x%08lx,%p,0x%08x,0x%08x,%p),stub!\n",
227         ExistingToken, DesiredAccess, ObjectAttributes,
228         ImpersonationLevel, TokenType, NewToken);
229         dump_ObjectAttributes(ObjectAttributes);
230         return 0;
231 }
232
233 /******************************************************************************
234  *  NtOpenProcessToken          [NTDLL.@]
235  *  ZwOpenProcessToken          [NTDLL.@]
236  */
237 NTSTATUS WINAPI NtOpenProcessToken(
238         HANDLE ProcessHandle,
239         DWORD DesiredAccess, 
240         HANDLE *TokenHandle) 
241 {
242         FIXME("(0x%08x,0x%08lx,%p): stub\n",
243         ProcessHandle,DesiredAccess, TokenHandle);
244         *TokenHandle = 0xcafe;
245         return 0;
246 }
247
248 /******************************************************************************
249  *  NtOpenThreadToken           [NTDLL.@]
250  *  ZwOpenThreadToken           [NTDLL.@]
251  */
252 NTSTATUS WINAPI NtOpenThreadToken(
253         HANDLE ThreadHandle,
254         DWORD DesiredAccess, 
255         BOOLEAN OpenAsSelf,
256         HANDLE *TokenHandle) 
257 {
258         FIXME("(0x%08x,0x%08lx,0x%08x,%p): stub\n",
259         ThreadHandle,DesiredAccess, OpenAsSelf, TokenHandle);
260         *TokenHandle = 0xcafe;
261         return 0;
262 }
263
264 /******************************************************************************
265  *  NtAdjustPrivilegesToken             [NTDLL.@]
266  *  ZwAdjustGroupsToken         [NTDLL.@]
267  *
268  * FIXME: parameters unsafe
269  */
270 NTSTATUS WINAPI NtAdjustPrivilegesToken(
271         IN HANDLE TokenHandle,
272         IN BOOLEAN DisableAllPrivileges,
273         IN PTOKEN_PRIVILEGES NewState,
274         IN DWORD BufferLength,
275         OUT PTOKEN_PRIVILEGES PreviousState,
276         OUT PDWORD ReturnLength)
277 {
278         FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p,%p),stub!\n",
279         TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength);
280         return 0;
281 }
282
283 /******************************************************************************
284 *  NtQueryInformationToken              [NTDLL.@]
285 *  ZwQueryInformationToken              [NTDLL.@]
286 *
287 * NOTES
288 *  Buffer for TokenUser:
289 *   0x00 TOKEN_USER the PSID field points to the SID
290 *   0x08 SID
291 *
292 */
293 NTSTATUS WINAPI NtQueryInformationToken(
294         HANDLE token,
295         DWORD tokeninfoclass, 
296         LPVOID tokeninfo,
297         DWORD tokeninfolength,
298         LPDWORD retlen ) 
299 {
300     unsigned int len = 0;
301
302     FIXME("(%08x,%ld,%p,%ld,%p): stub\n",
303           token,tokeninfoclass,tokeninfo,tokeninfolength,retlen);
304
305     switch (tokeninfoclass)
306     {
307     case TokenUser:
308         len = sizeof(TOKEN_USER) + sizeof(SID);
309         break;
310     case TokenGroups:
311         len = sizeof(TOKEN_GROUPS);
312         break;
313     case TokenPrivileges:
314         len = sizeof(TOKEN_PRIVILEGES);
315         break;
316     case TokenOwner:
317         len = sizeof(TOKEN_OWNER);
318         break;
319     case TokenPrimaryGroup:
320         len = sizeof(TOKEN_PRIMARY_GROUP);
321         break;
322     case TokenDefaultDacl:
323         len = sizeof(TOKEN_DEFAULT_DACL);
324         break;
325     case TokenSource:
326         len = sizeof(TOKEN_SOURCE);
327         break;
328     case TokenType:
329         len = sizeof (TOKEN_TYPE);
330         break;
331 #if 0
332     case TokenImpersonationLevel:
333     case TokenStatistics:
334 #endif /* 0 */
335     }
336
337     /* FIXME: what if retlen == NULL ? */
338     *retlen = len;
339
340     if (tokeninfolength < len)
341         return STATUS_BUFFER_TOO_SMALL;
342
343     switch (tokeninfoclass)
344     {
345     case TokenUser:
346         if( tokeninfo )
347         {
348             TOKEN_USER * tuser = tokeninfo;
349             PSID sid = (PSID) (tuser + 1);
350             SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
351             RtlInitializeSid(sid, &localSidAuthority, 1);
352             *(RtlSubAuthoritySid(sid, 0)) = SECURITY_INTERACTIVE_RID;
353             tuser->User.Sid = sid;
354         }
355         break;
356     case TokenGroups:
357         if (tokeninfo)
358         {
359             TOKEN_GROUPS *tgroups = tokeninfo;
360             SID_IDENTIFIER_AUTHORITY sid = {SECURITY_NT_AUTHORITY};
361
362             /* we need to show admin privileges ! */
363             tgroups->GroupCount = 1;
364             RtlAllocateAndInitializeSid( &sid,
365                                          2,
366                                          SECURITY_BUILTIN_DOMAIN_RID,
367                                          DOMAIN_ALIAS_RID_ADMINS,
368                                          0, 0, 0, 0, 0, 0,
369                                          &(tgroups->Groups->Sid));
370         }
371         break;
372     case TokenPrivileges:
373         if (tokeninfo)
374         {
375             TOKEN_PRIVILEGES *tpriv = tokeninfo;
376             tpriv->PrivilegeCount = 1;
377         }
378         break;
379     }
380     return 0;
381 }
382
383 /*
384  *      Section
385  */
386  
387 /******************************************************************************
388  *  NtCreateSection     [NTDLL.@]
389  *  ZwCreateSection     [NTDLL.@]
390  */
391 NTSTATUS WINAPI NtCreateSection(
392         OUT PHANDLE SectionHandle,
393         IN ACCESS_MASK DesiredAccess,
394         IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
395         IN PLARGE_INTEGER MaximumSize OPTIONAL,
396         IN ULONG SectionPageProtection OPTIONAL,
397         IN ULONG AllocationAttributes,
398         IN HANDLE FileHandle OPTIONAL)
399 {
400         FIXME("(%p,0x%08lx,%p,%p,0x%08lx,0x%08lx,0x%08x) stub\n",
401         SectionHandle,DesiredAccess, ObjectAttributes,
402         MaximumSize,SectionPageProtection,AllocationAttributes,FileHandle);
403         dump_ObjectAttributes(ObjectAttributes);
404         return 0;
405 }
406
407 /******************************************************************************
408  *  NtOpenSection       [NTDLL.@]
409  *  ZwOpenSection       [NTDLL.@]
410  */
411 NTSTATUS WINAPI NtOpenSection(
412         PHANDLE SectionHandle,
413         ACCESS_MASK DesiredAccess,
414         POBJECT_ATTRIBUTES ObjectAttributes)
415 {
416         FIXME("(%p,0x%08lx,%p),stub!\n",
417         SectionHandle,DesiredAccess,ObjectAttributes);
418         dump_ObjectAttributes(ObjectAttributes);
419         return 0;
420 }
421
422 /******************************************************************************
423  *  NtQuerySection      [NTDLL.@]
424  */
425 NTSTATUS WINAPI NtQuerySection(
426         IN HANDLE SectionHandle,
427         IN PVOID SectionInformationClass,
428         OUT PVOID SectionInformation,
429         IN ULONG Length,
430         OUT PULONG ResultLength)
431 {
432         FIXME("(0x%08x,%p,%p,0x%08lx,%p) stub!\n",
433         SectionHandle,SectionInformationClass,SectionInformation,Length,ResultLength);
434         return 0;
435 }
436
437 /******************************************************************************
438  * NtMapViewOfSection   [NTDLL.@]
439  * ZwMapViewOfSection   [NTDLL.@]
440  * FUNCTION: Maps a view of a section into the virtual address space of a process
441  *
442  * ARGUMENTS:
443  *  SectionHandle       Handle of the section
444  *  ProcessHandle       Handle of the process
445  *  BaseAddress         Desired base address (or NULL) on entry
446  *                      Actual base address of the view on exit
447  *  ZeroBits            Number of high order address bits that must be zero
448  *  CommitSize          Size in bytes of the initially committed section of the view
449  *  SectionOffset       Offset in bytes from the beginning of the section to the beginning of the view
450  *  ViewSize            Desired length of map (or zero to map all) on entry 
451                         Actual length mapped on exit
452  *  InheritDisposition  Specified how the view is to be shared with
453  *                      child processes
454  *  AllocateType        Type of allocation for the pages
455  *  Protect             Protection for the committed region of the view
456  */
457 NTSTATUS WINAPI NtMapViewOfSection(
458         HANDLE SectionHandle,
459         HANDLE ProcessHandle,
460         PVOID* BaseAddress,
461         ULONG ZeroBits,
462         ULONG CommitSize,
463         PLARGE_INTEGER SectionOffset,
464         PULONG ViewSize,
465         SECTION_INHERIT InheritDisposition,
466         ULONG AllocationType,
467         ULONG Protect)
468 {
469         FIXME("(0x%08x,0x%08x,%p,0x%08lx,0x%08lx,%p,%p,0x%08x,0x%08lx,0x%08lx) stub\n",
470         SectionHandle,ProcessHandle,BaseAddress,ZeroBits,CommitSize,SectionOffset,
471         ViewSize,InheritDisposition,AllocationType,Protect);
472         return 0;
473 }
474
475 /*
476  *      ports
477  */
478
479 /******************************************************************************
480  *  NtCreatePort                [NTDLL.@]
481  *  ZwCreatePort                [NTDLL.@]
482  */
483 NTSTATUS WINAPI NtCreatePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) 
484 {
485         FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5);
486         return 0;
487 }
488
489 /******************************************************************************
490  *  NtConnectPort               [NTDLL.@]
491  *  ZwConnectPort               [NTDLL.@]
492  */
493 NTSTATUS WINAPI NtConnectPort(DWORD x1,PUNICODE_STRING uni,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8) 
494 {
495         FIXME("(0x%08lx,%s,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",
496         x1,debugstr_w(uni->Buffer),x3,x4,x5,x6,x7,x8);
497         return 0;
498 }
499
500 /******************************************************************************
501  *  NtListenPort                [NTDLL.@]
502  *  ZwListenPort                [NTDLL.@]
503  */
504 NTSTATUS WINAPI NtListenPort(DWORD x1,DWORD x2) 
505 {
506         FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
507         return 0;
508 }
509
510 /******************************************************************************
511  *  NtAcceptConnectPort [NTDLL.@]
512  *  ZwAcceptConnectPort [NTDLL.@]
513  */
514 NTSTATUS WINAPI NtAcceptConnectPort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6) 
515 {
516         FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6);
517         return 0;
518 }
519
520 /******************************************************************************
521  *  NtCompleteConnectPort       [NTDLL.@]
522  *  ZwCompleteConnectPort       [NTDLL.@]
523  */
524 NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1) 
525 {
526         FIXME("(0x%08lx),stub!\n",x1);
527         return 0;
528 }
529
530 /******************************************************************************
531  *  NtRegisterThreadTerminatePort       [NTDLL.@]
532  *  ZwRegisterThreadTerminatePort       [NTDLL.@]
533  */
534 NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1) 
535 {
536         FIXME("(0x%08lx),stub!\n",x1);
537         return 0;
538 }
539
540 /******************************************************************************
541  *  NtRequestWaitReplyPort              [NTDLL.@]
542  *  ZwRequestWaitReplyPort              [NTDLL.@]
543  */
544 NTSTATUS WINAPI NtRequestWaitReplyPort(DWORD x1,DWORD x2,DWORD x3) 
545 {
546         FIXME("(0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3);
547         return 0;
548 }
549
550 /******************************************************************************
551  *  NtReplyWaitReceivePort      [NTDLL.@]
552  *  ZwReplyWaitReceivePort      [NTDLL.@]
553  */
554 NTSTATUS WINAPI NtReplyWaitReceivePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4) 
555 {
556         FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4);
557         return 0;
558 }
559
560 /*
561  *      Misc
562  */
563
564  /******************************************************************************
565  *  NtSetIntervalProfile        [NTDLL.@]
566  *  ZwSetIntervalProfile        [NTDLL.@]
567  */
568 NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,DWORD x2) {
569         FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
570         return 0;
571 }
572
573 /******************************************************************************
574  *  NtQueryPerformanceCounter   [NTDLL.@]
575  */
576 NTSTATUS WINAPI NtQueryPerformanceCounter(
577         IN PLARGE_INTEGER Counter,
578         IN PLARGE_INTEGER Frequency) 
579 {
580         FIXME("(%p, 0%p) stub\n",
581         Counter, Frequency);
582         return 0;
583 }
584
585 /******************************************************************************
586  *  NtCreateMailslotFile        [NTDLL.@]
587  *  ZwCreateMailslotFile        [NTDLL.@]
588  */
589 NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8) 
590 {
591         FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6,x7,x8);
592         return 0;
593 }
594
595 /******************************************************************************
596  * NtQuerySystemInformation [NTDLL.@]
597  * ZwQuerySystemInformation [NTDLL.@]
598  *
599  * ARGUMENTS:
600  *  SystemInformationClass      Index to a certain information structure
601  *      SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
602  *      SystemCacheInformation          SYSTEM_CACHE_INFORMATION
603  *      SystemConfigurationInformation  CONFIGURATION_INFORMATION
604  *      observed (class/len): 
605  *              0x0/0x2c
606  *              0x12/0x18
607  *              0x2/0x138
608  *              0x8/0x600
609  *              0x25/0xc
610  *  SystemInformation   caller supplies storage for the information structure
611  *  Length              size of the structure
612  *  ResultLength        Data written
613  */
614 NTSTATUS WINAPI NtQuerySystemInformation(
615         IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
616         OUT PVOID SystemInformation,
617         IN ULONG Length,
618         OUT PULONG ResultLength)
619 {
620     switch(SystemInformationClass)
621     {
622     case 0x25:
623         /* Something to do with the size of the registry             *
624          * Since we don't have a size limitation, fake it            *
625          * This is almost certainly wrong.                           *
626          * This sets each of the three words in the struct to 32 MB, *
627          * which is enough to make the IE 5 installer happy.         */
628         FIXME("(0x%08x,%p,0x%08lx,%p) faking max registry size of 32 MB\n",
629               SystemInformationClass,SystemInformation,Length,ResultLength);
630         *(DWORD *)SystemInformation = 0x2000000;
631         *(((DWORD *)SystemInformation)+1) = 0x200000;
632         *(((DWORD *)SystemInformation)+2) = 0x200000;
633         break;
634
635     default:
636         FIXME("(0x%08x,%p,0x%08lx,%p) stub\n",
637               SystemInformationClass,SystemInformation,Length,ResultLength);
638         ZeroMemory (SystemInformation, Length);
639     }
640
641     return STATUS_SUCCESS;
642 }
643
644
645 /******************************************************************************
646  *  NtCreatePagingFile          [NTDLL.@]
647  *  ZwCreatePagingFile          [NTDLL.@]
648  */
649 NTSTATUS WINAPI NtCreatePagingFile(
650         IN PUNICODE_STRING PageFileName,
651         IN ULONG MiniumSize,
652         IN ULONG MaxiumSize,
653         OUT PULONG ActualSize)
654 {
655         FIXME("(%p(%s),0x%08lx,0x%08lx,%p),stub!\n",
656         PageFileName->Buffer, debugstr_w(PageFileName->Buffer),MiniumSize,MaxiumSize,ActualSize);
657         return 0;
658 }
659
660 /******************************************************************************
661  *  NtDisplayString                             [NTDLL.@]
662  * 
663  * writes a string to the nt-textmode screen eg. during startup
664  */
665 NTSTATUS WINAPI NtDisplayString ( PUNICODE_STRING string )
666 {
667     STRING stringA;
668     NTSTATUS ret;
669
670     if (!(ret = RtlUnicodeStringToAnsiString( &stringA, string, TRUE )))
671     {
672         MESSAGE( "%.*s", stringA.Length, stringA.Buffer );
673         RtlFreeAnsiString( &stringA );
674     }
675     return ret;
676 }
677
678 /******************************************************************************
679  *  NtPowerInformation                          [NTDLL.@]
680  * 
681  */
682 NTSTATUS WINAPI NtPowerInformation(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5)
683 {
684         FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub\n",x1,x2,x3,x4,x5);
685         return 0;
686 }
687
688 /******************************************************************************
689  *  NtAllocateLocallyUniqueId (NTDLL.@)
690  *
691  * FIXME: the server should do that
692  */
693 NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID Luid)
694 {
695     static LUID luid;
696
697     FIXME("%p (0x%08lx%08lx)\n", Luid, luid.HighPart, luid.LowPart);
698
699     luid.LowPart++;
700     if (luid.LowPart==0)
701         luid.HighPart++;
702     Luid->HighPart = luid.HighPart;
703     Luid->LowPart = luid.LowPart;
704
705     return STATUS_SUCCESS;
706 }