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