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