Added NtQueryProcessInformation case needed by NT version of MSI.
[wine/wine-kai.git] / dlls / ntdll / nt.c
blob4c2aa2ef53e2dd92c6a114918187833c38a2bb85
1 /*
2 * NT basis DLL
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)
7 * Copyright 1996-1998 Marcus Meissner
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.
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.
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
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <time.h>
28 #include "wine/debug.h"
30 #include "winternl.h"
31 #include "ntdll_misc.h"
32 #include "wine/server.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
36 /* Structures used by NtConnectPort */
38 typedef struct LpcSectionInfo
40 DWORD Length;
41 HANDLE SectionHandle;
42 DWORD Param1;
43 DWORD SectionSize;
44 DWORD ClientBaseAddress;
45 DWORD ServerBaseAddress;
46 } LPCSECTIONINFO, *PLPCSECTIONINFO;
48 typedef struct LpcSectionMapInfo
50 DWORD Length;
51 DWORD SectionSize;
52 DWORD ServerBaseAddress;
53 } LPCSECTIONMAPINFO, *PLPCSECTIONMAPINFO;
55 /* Structure used by NtAcceptConnectPort, NtReplyWaitReceivePort */
57 #define MAX_MESSAGE_DATA 328
59 typedef struct LpcMessage
61 WORD ActualMessageLength;
62 WORD TotalMessageLength;
63 DWORD MessageType;
64 DWORD ClientProcessId;
65 DWORD ClientThreadId;
66 DWORD MessageId;
67 DWORD SharedSectionSize;
68 BYTE MessageData[MAX_MESSAGE_DATA];
69 } LPCMESSAGE, *PLPCMESSAGE;
72 * Timer object
75 /**************************************************************************
76 * NtCreateTimer [NTDLL.@]
77 * ZwCreateTimer [NTDLL.@]
79 NTSTATUS WINAPI NtCreateTimer(
80 OUT PHANDLE TimerHandle,
81 IN ACCESS_MASK DesiredAccess,
82 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
83 IN TIMER_TYPE TimerType)
85 FIXME("(%p,0x%08lx,%p,0x%08x) stub\n",
86 TimerHandle,DesiredAccess,ObjectAttributes, TimerType);
87 dump_ObjectAttributes(ObjectAttributes);
88 return 0;
90 /**************************************************************************
91 * NtSetTimer [NTDLL.@]
92 * ZwSetTimer [NTDLL.@]
94 NTSTATUS WINAPI NtSetTimer(
95 IN HANDLE TimerHandle,
96 IN PLARGE_INTEGER DueTime,
97 IN PTIMERAPCROUTINE TimerApcRoutine,
98 IN PVOID TimerContext,
99 IN BOOLEAN WakeTimer,
100 IN ULONG Period OPTIONAL,
101 OUT PBOOLEAN PreviousState OPTIONAL)
103 FIXME("(%p,%p,%p,%p,%08x,0x%08lx,%p) stub\n",
104 TimerHandle,DueTime,TimerApcRoutine,TimerContext,WakeTimer,Period,PreviousState);
105 return 0;
108 /******************************************************************************
109 * NtQueryTimerResolution [NTDLL.@]
111 NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3)
113 FIXME("(0x%08lx,0x%08lx,0x%08lx), stub!\n",x1,x2,x3);
114 return 1;
118 * Process object
121 /******************************************************************************
122 * NtTerminateProcess [NTDLL.@]
124 * Native applications must kill themselves when done
126 NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
128 NTSTATUS ret;
129 BOOL self;
130 SERVER_START_REQ( terminate_process )
132 req->handle = handle;
133 req->exit_code = exit_code;
134 ret = wine_server_call( req );
135 self = !ret && reply->self;
137 SERVER_END_REQ;
138 if (self) exit( exit_code );
139 return ret;
142 /******************************************************************************
143 * NtQueryInformationProcess [NTDLL.@]
144 * ZwQueryInformationProcess [NTDLL.@]
147 NTSTATUS WINAPI NtQueryInformationProcess(
148 IN HANDLE ProcessHandle,
149 IN PROCESSINFOCLASS ProcessInformationClass,
150 OUT PVOID ProcessInformation,
151 IN ULONG ProcessInformationLength,
152 OUT PULONG ReturnLength)
154 NTSTATUS ret = STATUS_SUCCESS;
155 ULONG len = 0;
157 switch (ProcessInformationClass) {
158 case ProcessDebugPort:
159 /* "These are not the debuggers you are looking for." */
160 /* set it to 0 aka "no debugger" to satisfy copy protections */
161 if (ProcessInformationLength == 4)
163 memset(ProcessInformation,0,ProcessInformationLength);
164 len = 4;
166 else
167 ret = STATUS_INFO_LENGTH_MISMATCH;
168 break;
169 case ProcessWow64Information:
170 if (ProcessInformationLength == 4)
172 memset(ProcessInformation,0,ProcessInformationLength);
173 len = 4;
175 else
176 ret = STATUS_INFO_LENGTH_MISMATCH;
177 break;
178 default:
179 FIXME("(%p,0x%08x,%p,0x%08lx,%p),stub!\n",
180 ProcessHandle,ProcessInformationClass,
181 ProcessInformation,ProcessInformationLength,
182 ReturnLength
184 break;
187 if (ReturnLength)
188 *ReturnLength = len;
190 return ret;
193 /******************************************************************************
194 * NtSetInformationProcess [NTDLL.@]
195 * ZwSetInformationProcess [NTDLL.@]
197 NTSTATUS WINAPI NtSetInformationProcess(
198 IN HANDLE ProcessHandle,
199 IN PROCESSINFOCLASS ProcessInformationClass,
200 IN PVOID ProcessInformation,
201 IN ULONG ProcessInformationLength)
203 FIXME("(%p,0x%08x,%p,0x%08lx) stub\n",
204 ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength);
205 return 0;
209 * Thread
212 /******************************************************************************
213 * NtQueryInformationThread [NTDLL.@]
214 * ZwQueryInformationThread [NTDLL.@]
217 NTSTATUS WINAPI NtQueryInformationThread(
218 IN HANDLE ThreadHandle,
219 IN THREADINFOCLASS ThreadInformationClass,
220 OUT PVOID ThreadInformation,
221 IN ULONG ThreadInformationLength,
222 OUT PULONG ReturnLength)
224 FIXME("(%p,0x%08x,%p,0x%08lx,%p),stub!\n",
225 ThreadHandle, ThreadInformationClass, ThreadInformation,
226 ThreadInformationLength, ReturnLength);
227 return 0;
230 /******************************************************************************
231 * NtSetInformationThread [NTDLL.@]
232 * ZwSetInformationThread [NTDLL.@]
234 NTSTATUS WINAPI NtSetInformationThread(
235 HANDLE ThreadHandle,
236 THREADINFOCLASS ThreadInformationClass,
237 PVOID ThreadInformation,
238 ULONG ThreadInformationLength)
240 FIXME("(%p,0x%08x,%p,0x%08lx),stub!\n",
241 ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength);
242 return 0;
246 * Token
249 /******************************************************************************
250 * NtDuplicateToken [NTDLL.@]
251 * ZwDuplicateToken [NTDLL.@]
253 NTSTATUS WINAPI NtDuplicateToken(
254 IN HANDLE ExistingToken,
255 IN ACCESS_MASK DesiredAccess,
256 IN POBJECT_ATTRIBUTES ObjectAttributes,
257 IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
258 IN TOKEN_TYPE TokenType,
259 OUT PHANDLE NewToken)
261 FIXME("(%p,0x%08lx,%p,0x%08x,0x%08x,%p),stub!\n",
262 ExistingToken, DesiredAccess, ObjectAttributes,
263 ImpersonationLevel, TokenType, NewToken);
264 dump_ObjectAttributes(ObjectAttributes);
265 return 0;
268 /******************************************************************************
269 * NtOpenProcessToken [NTDLL.@]
270 * ZwOpenProcessToken [NTDLL.@]
272 NTSTATUS WINAPI NtOpenProcessToken(
273 HANDLE ProcessHandle,
274 DWORD DesiredAccess,
275 HANDLE *TokenHandle)
277 FIXME("(%p,0x%08lx,%p): stub\n",
278 ProcessHandle,DesiredAccess, TokenHandle);
279 *TokenHandle = (HANDLE)0xcafe;
280 return 0;
283 /******************************************************************************
284 * NtOpenThreadToken [NTDLL.@]
285 * ZwOpenThreadToken [NTDLL.@]
287 NTSTATUS WINAPI NtOpenThreadToken(
288 HANDLE ThreadHandle,
289 DWORD DesiredAccess,
290 BOOLEAN OpenAsSelf,
291 HANDLE *TokenHandle)
293 FIXME("(%p,0x%08lx,0x%08x,%p): stub\n",
294 ThreadHandle,DesiredAccess, OpenAsSelf, TokenHandle);
295 *TokenHandle = (HANDLE)0xcafe;
296 return 0;
299 /******************************************************************************
300 * NtAdjustPrivilegesToken [NTDLL.@]
301 * ZwAdjustGroupsToken [NTDLL.@]
303 * FIXME: parameters unsafe
305 NTSTATUS WINAPI NtAdjustPrivilegesToken(
306 IN HANDLE TokenHandle,
307 IN BOOLEAN DisableAllPrivileges,
308 IN PTOKEN_PRIVILEGES NewState,
309 IN DWORD BufferLength,
310 OUT PTOKEN_PRIVILEGES PreviousState,
311 OUT PDWORD ReturnLength)
313 FIXME("(%p,0x%08x,%p,0x%08lx,%p,%p),stub!\n",
314 TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength);
315 return 0;
318 /******************************************************************************
319 * NtQueryInformationToken [NTDLL.@]
320 * ZwQueryInformationToken [NTDLL.@]
322 * NOTES
323 * Buffer for TokenUser:
324 * 0x00 TOKEN_USER the PSID field points to the SID
325 * 0x08 SID
328 NTSTATUS WINAPI NtQueryInformationToken(
329 HANDLE token,
330 DWORD tokeninfoclass,
331 LPVOID tokeninfo,
332 DWORD tokeninfolength,
333 LPDWORD retlen )
335 unsigned int len = 0;
337 FIXME("(%p,%ld,%p,%ld,%p): stub\n",
338 token,tokeninfoclass,tokeninfo,tokeninfolength,retlen);
340 switch (tokeninfoclass)
342 case TokenUser:
343 len = sizeof(TOKEN_USER) + sizeof(SID);
344 break;
345 case TokenGroups:
346 len = sizeof(TOKEN_GROUPS);
347 break;
348 case TokenPrivileges:
349 len = sizeof(TOKEN_PRIVILEGES);
350 break;
351 case TokenOwner:
352 len = sizeof(TOKEN_OWNER);
353 break;
354 case TokenPrimaryGroup:
355 len = sizeof(TOKEN_PRIMARY_GROUP);
356 break;
357 case TokenDefaultDacl:
358 len = sizeof(TOKEN_DEFAULT_DACL);
359 break;
360 case TokenSource:
361 len = sizeof(TOKEN_SOURCE);
362 break;
363 case TokenType:
364 len = sizeof (TOKEN_TYPE);
365 break;
366 #if 0
367 case TokenImpersonationLevel:
368 case TokenStatistics:
369 #endif /* 0 */
372 /* FIXME: what if retlen == NULL ? */
373 *retlen = len;
375 if (tokeninfolength < len)
376 return STATUS_BUFFER_TOO_SMALL;
378 switch (tokeninfoclass)
380 case TokenUser:
381 if( tokeninfo )
383 TOKEN_USER * tuser = tokeninfo;
384 PSID sid = (PSID) (tuser + 1);
385 SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
386 RtlInitializeSid(sid, &localSidAuthority, 1);
387 *(RtlSubAuthoritySid(sid, 0)) = SECURITY_INTERACTIVE_RID;
388 tuser->User.Sid = sid;
390 break;
391 case TokenGroups:
392 if (tokeninfo)
394 TOKEN_GROUPS *tgroups = tokeninfo;
395 SID_IDENTIFIER_AUTHORITY sid = {SECURITY_NT_AUTHORITY};
397 /* we need to show admin privileges ! */
398 tgroups->GroupCount = 1;
399 RtlAllocateAndInitializeSid( &sid,
401 SECURITY_BUILTIN_DOMAIN_RID,
402 DOMAIN_ALIAS_RID_ADMINS,
403 0, 0, 0, 0, 0, 0,
404 &(tgroups->Groups->Sid));
406 break;
407 case TokenPrivileges:
408 if (tokeninfo)
410 TOKEN_PRIVILEGES *tpriv = tokeninfo;
411 tpriv->PrivilegeCount = 1;
413 break;
415 return 0;
419 * Section
422 /******************************************************************************
423 * NtQuerySection [NTDLL.@]
425 NTSTATUS WINAPI NtQuerySection(
426 IN HANDLE SectionHandle,
427 IN PVOID SectionInformationClass,
428 OUT PVOID SectionInformation,
429 IN ULONG Length,
430 OUT PULONG ResultLength)
432 FIXME("(%p,%p,%p,0x%08lx,%p) stub!\n",
433 SectionHandle,SectionInformationClass,SectionInformation,Length,ResultLength);
434 return 0;
438 * ports
441 /******************************************************************************
442 * NtCreatePort [NTDLL.@]
443 * ZwCreatePort [NTDLL.@]
445 NTSTATUS WINAPI NtCreatePort(PHANDLE PortHandle,POBJECT_ATTRIBUTES ObjectAttributes,
446 DWORD MaxConnectInfoLength,DWORD MaxDataLength,DWORD unknown)
448 FIXME("(%p,%p,0x%08lx,0x%08lx,0x%08lx),stub!\n",PortHandle,ObjectAttributes,
449 MaxConnectInfoLength,MaxDataLength,unknown);
450 return 0;
453 /******************************************************************************
454 * NtConnectPort [NTDLL.@]
455 * ZwConnectPort [NTDLL.@]
457 NTSTATUS WINAPI NtConnectPort(PHANDLE PortHandle,PUNICODE_STRING PortName,PVOID Unknown1,
458 PLPCSECTIONINFO sectionInfo,PLPCSECTIONMAPINFO mapInfo,PVOID Unknown2,
459 PVOID ConnectInfo,PDWORD pConnectInfoLength)
461 FIXME("(%p,%s,%p,%p,%p,%p,%p,%p (%ld)),stub!\n",PortHandle,debugstr_w(PortName->Buffer),Unknown1,
462 sectionInfo,mapInfo,Unknown2,ConnectInfo,pConnectInfoLength,pConnectInfoLength?*pConnectInfoLength:-1);
463 if(ConnectInfo && pConnectInfoLength)
464 TRACE("\tMessage = %s\n",debugstr_an(ConnectInfo,*pConnectInfoLength));
465 return 0;
468 /******************************************************************************
469 * NtListenPort [NTDLL.@]
470 * ZwListenPort [NTDLL.@]
472 NTSTATUS WINAPI NtListenPort(HANDLE PortHandle,PLPCMESSAGE pLpcMessage)
474 FIXME("(%p,%p),stub!\n",PortHandle,pLpcMessage);
475 return 0;
478 /******************************************************************************
479 * NtAcceptConnectPort [NTDLL.@]
480 * ZwAcceptConnectPort [NTDLL.@]
482 NTSTATUS WINAPI NtAcceptConnectPort(PHANDLE PortHandle,DWORD Unknown,PLPCMESSAGE pLpcMessage,
483 DWORD acceptIt,DWORD Unknown2,PLPCSECTIONMAPINFO mapInfo)
485 FIXME("(%p,0x%08lx,%p,0x%08lx,0x%08lx,%p),stub!\n",PortHandle,Unknown,pLpcMessage,acceptIt,Unknown2,mapInfo);
486 return 0;
489 /******************************************************************************
490 * NtCompleteConnectPort [NTDLL.@]
491 * ZwCompleteConnectPort [NTDLL.@]
493 NTSTATUS WINAPI NtCompleteConnectPort(HANDLE PortHandle)
495 FIXME("(%p),stub!\n",PortHandle);
496 return 0;
499 /******************************************************************************
500 * NtRegisterThreadTerminatePort [NTDLL.@]
501 * ZwRegisterThreadTerminatePort [NTDLL.@]
503 NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE PortHandle)
505 FIXME("(%p),stub!\n",PortHandle);
506 return 0;
509 /******************************************************************************
510 * NtRequestWaitReplyPort [NTDLL.@]
511 * ZwRequestWaitReplyPort [NTDLL.@]
513 NTSTATUS WINAPI NtRequestWaitReplyPort(HANDLE PortHandle,PLPCMESSAGE pLpcMessageIn,PLPCMESSAGE pLpcMessageOut)
515 FIXME("(%p,%p,%p),stub!\n",PortHandle,pLpcMessageIn,pLpcMessageOut);
516 if(pLpcMessageIn)
518 TRACE("Message to send:\n");
519 TRACE("\tActualMessageLength = %d\n",pLpcMessageIn->ActualMessageLength);
520 TRACE("\tTotalMessageLength = %d\n",pLpcMessageIn->TotalMessageLength);
521 TRACE("\tMessageType = %ld\n",pLpcMessageIn->MessageType);
522 TRACE("\tClientProcessId = %ld\n",pLpcMessageIn->ClientProcessId);
523 TRACE("\tClientThreadId = %ld\n",pLpcMessageIn->ClientThreadId);
524 TRACE("\tMessageId = %ld\n",pLpcMessageIn->MessageId);
525 TRACE("\tSharedSectionSize = %ld\n",pLpcMessageIn->SharedSectionSize);
526 TRACE("\tMessageData = %s\n",debugstr_an(pLpcMessageIn->MessageData,pLpcMessageIn->ActualMessageLength));
528 return 0;
531 /******************************************************************************
532 * NtReplyWaitReceivePort [NTDLL.@]
533 * ZwReplyWaitReceivePort [NTDLL.@]
535 NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE PortHandle,PDWORD Unknown,PLPCMESSAGE pLpcMessageOut,PLPCMESSAGE pLpcMessageIn)
537 FIXME("(%p,%p,%p,%p),stub!\n",PortHandle,Unknown,pLpcMessageOut,pLpcMessageIn);
538 return 0;
542 * Misc
545 /******************************************************************************
546 * NtSetIntervalProfile [NTDLL.@]
547 * ZwSetIntervalProfile [NTDLL.@]
549 NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,DWORD x2) {
550 FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
551 return 0;
554 /******************************************************************************
555 * NtQueryPerformanceCounter [NTDLL.@]
557 NTSTATUS WINAPI NtQueryPerformanceCounter(
558 IN PLARGE_INTEGER Counter,
559 IN PLARGE_INTEGER Frequency)
561 FIXME("(%p, 0%p) stub\n",
562 Counter, Frequency);
563 return 0;
566 /******************************************************************************
567 * NtCreateMailslotFile [NTDLL.@]
568 * ZwCreateMailslotFile [NTDLL.@]
570 NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8)
572 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);
573 return 0;
576 /******************************************************************************
577 * NtQuerySystemInformation [NTDLL.@]
578 * ZwQuerySystemInformation [NTDLL.@]
580 * ARGUMENTS:
581 * SystemInformationClass Index to a certain information structure
582 * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
583 * SystemCacheInformation SYSTEM_CACHE_INFORMATION
584 * SystemConfigurationInformation CONFIGURATION_INFORMATION
585 * observed (class/len):
586 * 0x0/0x2c
587 * 0x12/0x18
588 * 0x2/0x138
589 * 0x8/0x600
590 * 0x25/0xc
591 * SystemInformation caller supplies storage for the information structure
592 * Length size of the structure
593 * ResultLength Data written
595 NTSTATUS WINAPI NtQuerySystemInformation(
596 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
597 OUT PVOID SystemInformation,
598 IN ULONG Length,
599 OUT PULONG ResultLength)
601 switch(SystemInformationClass)
603 case 0x25:
604 /* Something to do with the size of the registry *
605 * Since we don't have a size limitation, fake it *
606 * This is almost certainly wrong. *
607 * This sets each of the three words in the struct to 32 MB, *
608 * which is enough to make the IE 5 installer happy. */
609 FIXME("(0x%08x,%p,0x%08lx,%p) faking max registry size of 32 MB\n",
610 SystemInformationClass,SystemInformation,Length,ResultLength);
611 *(DWORD *)SystemInformation = 0x2000000;
612 *(((DWORD *)SystemInformation)+1) = 0x200000;
613 *(((DWORD *)SystemInformation)+2) = 0x200000;
614 break;
616 default:
617 FIXME("(0x%08x,%p,0x%08lx,%p) stub\n",
618 SystemInformationClass,SystemInformation,Length,ResultLength);
619 ZeroMemory (SystemInformation, Length);
622 return STATUS_SUCCESS;
626 /******************************************************************************
627 * NtCreatePagingFile [NTDLL.@]
628 * ZwCreatePagingFile [NTDLL.@]
630 NTSTATUS WINAPI NtCreatePagingFile(
631 IN PUNICODE_STRING PageFileName,
632 IN ULONG MiniumSize,
633 IN ULONG MaxiumSize,
634 OUT PULONG ActualSize)
636 FIXME("(%p(%s),0x%08lx,0x%08lx,%p),stub!\n",
637 PageFileName->Buffer, debugstr_w(PageFileName->Buffer),MiniumSize,MaxiumSize,ActualSize);
638 return 0;
641 /******************************************************************************
642 * NtDisplayString [NTDLL.@]
644 * writes a string to the nt-textmode screen eg. during startup
646 NTSTATUS WINAPI NtDisplayString ( PUNICODE_STRING string )
648 STRING stringA;
649 NTSTATUS ret;
651 if (!(ret = RtlUnicodeStringToAnsiString( &stringA, string, TRUE )))
653 MESSAGE( "%.*s", stringA.Length, stringA.Buffer );
654 RtlFreeAnsiString( &stringA );
656 return ret;
659 /******************************************************************************
660 * NtPowerInformation [NTDLL.@]
663 NTSTATUS WINAPI NtPowerInformation(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5)
665 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub\n",x1,x2,x3,x4,x5);
666 return 0;
669 /******************************************************************************
670 * NtAllocateLocallyUniqueId (NTDLL.@)
672 * FIXME: the server should do that
674 NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID Luid)
676 static LUID luid;
678 FIXME("%p (0x%08lx%08lx)\n", Luid, luid.HighPart, luid.LowPart);
680 luid.LowPart++;
681 if (luid.LowPart==0)
682 luid.HighPart++;
683 Luid->HighPart = luid.HighPart;
684 Luid->LowPart = luid.LowPart;
686 return STATUS_SUCCESS;
689 /******************************************************************************
690 * VerSetConditionMask (NTDLL.@)
692 ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBitMask,
693 BYTE dwConditionMask)
695 if(dwTypeBitMask == 0)
696 return dwlConditionMask;
697 dwConditionMask &= 0x07;
698 if(dwConditionMask == 0)
699 return dwlConditionMask;
701 if(dwTypeBitMask & VER_PRODUCT_TYPE)
702 dwlConditionMask |= dwConditionMask << 7*3;
703 else if (dwTypeBitMask & VER_SUITENAME)
704 dwlConditionMask |= dwConditionMask << 6*3;
705 else if (dwTypeBitMask & VER_SERVICEPACKMAJOR)
706 dwlConditionMask |= dwConditionMask << 5*3;
707 else if (dwTypeBitMask & VER_SERVICEPACKMINOR)
708 dwlConditionMask |= dwConditionMask << 4*3;
709 else if (dwTypeBitMask & VER_PLATFORMID)
710 dwlConditionMask |= dwConditionMask << 3*3;
711 else if (dwTypeBitMask & VER_BUILDNUMBER)
712 dwlConditionMask |= dwConditionMask << 2*3;
713 else if (dwTypeBitMask & VER_MAJORVERSION)
714 dwlConditionMask |= dwConditionMask << 1*3;
715 else if (dwTypeBitMask & VER_MINORVERSION)
716 dwlConditionMask |= dwConditionMask << 0*3;
717 return dwlConditionMask;