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