- New implementation of SendMessage, ReceiveMessage, ReplyMessage functions
[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 HAL)
6  *
7  * Copyright 1996-1998 Marcus Meissner
8  */
9
10 #include <stdlib.h>
11 #include <string.h>
12 #include <time.h>
13 #include "wintypes.h"
14 #include "windef.h"
15 #include "ntdll.h"
16 #include "ntdef.h"
17 #include "ntddk.h"
18 #include "debugstr.h"
19 #include "debug.h"
20
21 /* move to winbase.h */
22 typedef VOID (CALLBACK *PTIMERAPCROUTINE)(LPVOID lpArgToCompletionRoutine,DWORD dwTimerLowValue,DWORD dwTimerHighValue);   
23
24 /* move to somewhere */
25 typedef void * POBJDIR_INFORMATION;
26
27 /**************************************************************************
28  *                 NtOpenFile                           [NTDLL.127]
29  * FUNCTION: Opens a file
30  * ARGUMENTS:
31  *  FileHandle          Variable that receives the file handle on return
32  *  DesiredAccess       Access desired by the caller to the file
33  *  ObjectAttributes    Structue describing the file to be opened
34  *  IoStatusBlock       Receives details about the result of the operation
35  *  ShareAccess         Type of shared access the caller requires
36  *  OpenOptions         Options for the file open
37  */
38 NTSTATUS WINAPI NtOpenFile(
39         OUT PHANDLE FileHandle,
40         ACCESS_MASK DesiredAccess,
41         POBJECT_ATTRIBUTES ObjectAttributes,
42         OUT PIO_STATUS_BLOCK IoStatusBlock,
43         ULONG ShareAccess,
44         ULONG OpenOptions)
45 {
46         FIXME(ntdll,"(%p,0x%08lx,%p(%s),%p,0x%08lx,0x%08lx) stub\n",
47         FileHandle, DesiredAccess, ObjectAttributes, debugstr_w(ObjectAttributes->ObjectName->Buffer),
48         IoStatusBlock, ShareAccess, OpenOptions);
49         return 0;
50 }
51 /**************************************************************************
52  *              NtCreateFile                            [NTDLL.73]
53  * FUNCTION: Either causes a new file or directory to be created, or it opens
54  *  an existing file, device, directory or volume, giving the caller a handle
55  *  for the file object. This handle can be used by subsequent calls to
56  *  manipulate data within the file or the file object's state of attributes.
57  * ARGUMENTS:
58  *      FileHandle              Points to a variable which receives the file handle on return
59  *      DesiredAccess           Desired access to the file
60  *      ObjectAttributes        Structure describing the file
61  *      IoStatusBlock           Receives information about the operation on return
62  *      AllocationSize          Initial size of the file in bytes
63  *      FileAttributes          Attributes to create the file with
64  *      ShareAccess             Type of shared access the caller would like to the file
65  *      CreateDisposition       Specifies what to do, depending on whether the file already exists
66  *      CreateOptions           Options for creating a new file
67  *      EaBuffer                Undocumented
68  *      EaLength                Undocumented
69  */
70 NTSTATUS WINAPI NtCreateFile(
71         OUT PHANDLE FileHandle,
72         ACCESS_MASK DesiredAccess,
73         POBJECT_ATTRIBUTES ObjectAttributes,
74         OUT PIO_STATUS_BLOCK IoStatusBlock,
75         PLARGE_INTEGER AllocateSize,
76         ULONG FileAttributes,
77         ULONG ShareAccess,
78         ULONG CreateDisposition,
79         ULONG CreateOptions,
80         PVOID EaBuffer,
81         ULONG EaLength)  
82 {
83         FIXME(ntdll,"(%p,0x%08lx,%p(%s),%p,%p,0x%08lx,0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx) stub\n",
84         FileHandle,DesiredAccess,ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer),
85         IoStatusBlock,AllocateSize,FileAttributes,
86         ShareAccess,CreateDisposition,CreateOptions,EaBuffer,EaLength);
87         return 0;
88 }
89 /**************************************************************************
90  *              NtCreateTimer                           [NTDLL.87]
91  */
92 NTSTATUS WINAPI NtCreateTimer(
93         OUT PHANDLE TimerHandle,
94         IN ACCESS_MASK DesiredAccess,
95         IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
96         IN TIMER_TYPE TimerType)
97 {
98         FIXME(ntdll,"(%p,0x%08lx,%p(%s),0x%08x) stub\n",
99         TimerHandle,DesiredAccess,ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer),
100         TimerType);
101         return 0;
102 }
103 /**************************************************************************
104  *              NtSetTimer                              [NTDLL.221]
105  */
106 NTSTATUS WINAPI NtSetTimer(
107         IN HANDLE32 TimerHandle,
108         IN PLARGE_INTEGER DueTime,
109         IN PTIMERAPCROUTINE TimerApcRoutine,
110         IN PVOID TimerContext,
111         IN BOOL WakeTimer,
112         IN ULONG Period OPTIONAL,
113         OUT PBOOLEAN PreviousState OPTIONAL)
114 {
115         FIXME(ntdll,"(0x%08x,%p,%p,%p,%08lx,0x%08lx,%p) stub\n",
116         TimerHandle,DueTime,TimerApcRoutine,TimerContext,WakeTimer,Period,PreviousState);
117         return 0;
118 }
119
120 /**************************************************************************
121  *              NtCreateEvent                           [NTDLL.71]
122  */
123 NTSTATUS WINAPI NtCreateEvent(
124         OUT PHANDLE EventHandle,
125         IN ACCESS_MASK DesiredAccess,
126         IN POBJECT_ATTRIBUTES ObjectAttributes,
127         IN BOOLEAN ManualReset,
128         IN BOOLEAN InitialState)
129 {
130         FIXME(ntdll,"(%p,0x%08lx,%p(%s),%08x,%08x): empty stub\n",
131         EventHandle,DesiredAccess,ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer),
132         ManualReset,InitialState);
133         return 0;
134 }
135 /**************************************************************************
136  *              NtDeviceIoControlFile                   [NTDLL.94]
137  */
138 NTSTATUS WINAPI NtDeviceIoControlFile(
139         IN HANDLE32 DeviceHandle,
140         IN HANDLE32 Event OPTIONAL,
141         IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
142         IN PVOID UserApcContext OPTIONAL,
143         OUT PIO_STATUS_BLOCK IoStatusBlock,
144         IN ULONG IoControlCode,
145         IN PVOID InputBuffer,
146         IN ULONG InputBufferSize,
147         OUT PVOID OutputBuffer,
148         IN ULONG OutputBufferSize)
149 {
150         FIXME(ntdll,"(0x%08x,0x%08x,%p,%p,%p,0x%08lx,%p,0x%08lx,%p,0x%08lx): empty stub\n",
151         DeviceHandle, Event, UserApcRoutine, UserApcContext,
152         IoStatusBlock, IoControlCode, InputBuffer, InputBufferSize, OutputBuffer, OutputBufferSize);
153         return 0;
154 }
155
156 /**************************************************************************
157  * NtOpenDirectoryObject [NTDLL.124]
158  * FUNCTION: Opens a namespace directory object
159  * ARGUMENTS:
160  *  DirectoryHandle     Variable which receives the directory handle
161  *  DesiredAccess       Desired access to the directory
162  *  ObjectAttributes    Structure describing the directory
163  * RETURNS: Status
164  */
165 NTSTATUS WINAPI NtOpenDirectoryObject(
166         PHANDLE DirectoryHandle,
167         ACCESS_MASK DesiredAccess,
168         POBJECT_ATTRIBUTES ObjectAttributes)
169 {
170     FIXME(ntdll,"(%p,0x%08lx,%p(%s)): stub\n", 
171     DirectoryHandle, DesiredAccess, ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer));
172     return 0;
173 }
174
175
176 /******************************************************************************
177  * NtQueryDirectoryObject [NTDLL.149] 
178  * FUNCTION: Reads information from a namespace directory
179  * ARGUMENTS:
180  *  DirObjInformation   Buffer to hold the data read
181  *  BufferLength        Size of the buffer in bytes
182  *  GetNextIndex        If TRUE then set ObjectIndex to the index of the next object
183  *                      If FALSE then set ObjectIndex to the number of objects in the directory
184  *  IgnoreInputIndex    If TRUE start reading at index 0
185  *                      If FALSE start reading at the index specified by object index
186  *  ObjectIndex         Zero based index into the directory, interpretation depends on IgnoreInputIndex and GetNextIndex
187  *  DataWritten         Caller supplied storage for the number of bytes written (or NULL)
188  */
189 NTSTATUS WINAPI NtQueryDirectoryObject(
190         IN HANDLE32 DirObjHandle,
191         OUT POBJDIR_INFORMATION DirObjInformation,
192         IN ULONG BufferLength,
193         IN BOOLEAN GetNextIndex,
194         IN BOOLEAN IgnoreInputIndex,
195         IN OUT PULONG ObjectIndex,
196         OUT PULONG DataWritten OPTIONAL)
197 {
198         FIXME(ntdll,"(0x%08x,%p,0x%08lx,0x%08x,0x%08x,%p,%p) stub\n",
199                 DirObjHandle, DirObjInformation, BufferLength, GetNextIndex,
200                 IgnoreInputIndex, ObjectIndex, DataWritten);
201     return 0xc0000000; /* We don't have any. Whatever. (Yet.) */
202 }
203
204 /******************************************************************************
205  * NtQuerySystemInformation [NTDLL.168]
206  *
207  * ARGUMENTS:
208  *  SystemInformationClass      Index to a certain information structure
209  *      SystemTimeAdjustmentInformation       SYSTEM_TIME_ADJUSTMENT
210  *      SystemCacheInformation                SYSTEM_CACHE_INFORMATION
211  *      SystemConfigurationInformation        CONFIGURATION_INFORMATION
212  *      observed (class/len): 
213  *              0x0/0x2c
214  *              0x12/0x18
215  *              0x2/0x138
216  *              0x8/0x600
217  *  SystemInformation   caller supplies storage for the information structure
218  *  Length              size of the structure
219  *  ResultLength        Data written
220  */
221 NTSTATUS WINAPI NtQuerySystemInformation(
222         IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
223         OUT PVOID SystemInformation,
224         IN ULONG Length,
225         OUT PULONG ResultLength)
226 {
227         FIXME(ntdll,"(0x%08x,%p,0x%08lx,%p) stub\n",
228         SystemInformationClass,SystemInformation,Length,ResultLength);
229         ZeroMemory (SystemInformation, Length);
230         return 0;
231 }
232
233 /******************************************************************************
234  * NtQueryObject [NTDLL.161]
235  */
236 NTSTATUS WINAPI NtQueryObject(
237         IN HANDLE32 ObjectHandle,
238         IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
239         OUT PVOID ObjectInformation,
240         IN ULONG Length,
241         OUT PULONG ResultLength)
242 {
243         FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,%p): stub\n",
244         ObjectHandle, ObjectInformationClass, ObjectInformation, Length, ResultLength);
245         return 0;
246 }
247
248
249 /******************************************************************************
250  * NtSetInformationProcess [NTDLL.207]
251  */
252 NTSTATUS WINAPI NtSetInformationProcess(
253         IN HANDLE32 ProcessHandle,
254         IN PROCESSINFOCLASS ProcessInformationClass,
255         IN PVOID ProcessInformation,
256         IN ULONG ProcessInformationLength)
257 {
258         FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx) stub\n",
259         ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength);
260     return 0;
261 }
262
263 /******************************************************************************
264  * NtFsControlFile [NTDLL.108]
265  */
266 NTSTATUS WINAPI NtFsControlFile(
267         IN HANDLE32 DeviceHandle,
268         IN HANDLE32 Event OPTIONAL,
269         IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
270         IN PVOID ApcContext OPTIONAL,
271         OUT PIO_STATUS_BLOCK IoStatusBlock,
272         IN ULONG IoControlCode,
273         IN PVOID InputBuffer,
274         IN ULONG InputBufferSize,
275         OUT PVOID OutputBuffer,
276         IN ULONG OutputBufferSize)
277 {
278         FIXME(ntdll,"(0x%08x,0x%08x,%p,%p,%p,0x%08lx,%p,0x%08lx,%p,0x%08lx): stub\n",
279         DeviceHandle,Event,ApcRoutine,ApcContext,IoStatusBlock,IoControlCode,
280         InputBuffer,InputBufferSize,OutputBuffer,OutputBufferSize);
281         return 0;
282 }
283
284 /******************************************************************************
285  * NtQueryTimerResolution [NTDLL.129]
286  */
287 NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3) 
288 {
289         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx), stub!\n",x1,x2,x3);
290         return 1;
291 }
292 /**************************************************************************
293  *                 NtClose                              [NTDLL.65]
294  * FUNCTION: Closes a handle reference to an object
295  * ARGUMENTS:
296  *      Handle  handle to close
297  */
298 NTSTATUS WINAPI NtClose(
299         HANDLE32 Handle) 
300 {
301         FIXME(ntdll,"(0x%08x),stub!\n",Handle);
302         return 1;
303 }
304 /******************************************************************************
305 *  NtQueryInformationProcess            [NTDLL.] 
306 *
307 */
308 NTSTATUS WINAPI NtQueryInformationProcess(
309         IN HANDLE32 ProcessHandle,
310         IN PROCESSINFOCLASS ProcessInformationClass,
311         OUT PVOID ProcessInformation,
312         IN ULONG ProcessInformationLength,
313         OUT PULONG ReturnLength)
314 {
315         FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
316         ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength,ReturnLength);
317         return 0;
318 }
319 /******************************************************************************
320 *  NtQueryInformationThread             [NTDLL.] 
321 *
322 */
323 NTSTATUS WINAPI NtQueryInformationThread(
324         IN HANDLE32 ThreadHandle,
325         IN THREADINFOCLASS ThreadInformationClass,
326         OUT PVOID ThreadInformation,
327         IN ULONG ThreadInformationLength,
328         OUT PULONG ReturnLength)
329 {
330         FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
331                 ThreadHandle, ThreadInformationClass, ThreadInformation,
332                 ThreadInformationLength, ReturnLength);
333         return 0;
334 }
335 /******************************************************************************
336 *  NtQueryInformationToken              [NTDLL.156] 
337 *
338 */
339 NTSTATUS WINAPI NtQueryInformationToken(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) 
340 {
341         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",
342                 x1,x2,x3,x4,x5);
343         return 0;
344 }
345
346 /******************************************************************************
347  *  NtCreatePagingFile          [NTDLL] 
348  */
349 NTSTATUS WINAPI NtCreatePagingFile(
350         IN PUNICODE_STRING PageFileName,
351         IN ULONG MiniumSize,
352         IN ULONG MaxiumSize,
353         OUT PULONG ActualSize)
354 {
355         FIXME(ntdll,"(%p,0x%08lx,0x%08lx,%p),stub!\n",
356         PageFileName,MiniumSize,MaxiumSize,ActualSize);
357         return 0;
358 }
359
360 /******************************************************************************
361  *  NtDuplicateObject           [NTDLL] 
362  */
363 NTSTATUS WINAPI NtDuplicateObject(
364         IN HANDLE32 SourceProcessHandle,
365         IN PHANDLE SourceHandle,
366         IN HANDLE32 TargetProcessHandle,
367         OUT PHANDLE TargetHandle,
368         IN ACCESS_MASK DesiredAccess,
369         IN BOOLEAN InheritHandle,
370         ULONG Options)
371 {
372         FIXME(ntdll,"(0x%08x,%p,0x%08x,%p,0x%08lx,0x%08x,0x%08lx) stub!\n",
373         SourceProcessHandle,SourceHandle,TargetProcessHandle,TargetHandle,
374         DesiredAccess,InheritHandle,Options);
375         *TargetHandle = 0;
376         return 0;
377 }
378
379 /******************************************************************************
380  *  NtDuplicateToken            [NTDLL] 
381  */
382 NTSTATUS WINAPI NtDuplicateToken(
383         DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6
384 ) {
385         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6);
386         return 0;
387 }
388
389 /******************************************************************************
390  *  NtAdjustPrivilegesToken             [NTDLL] 
391  *
392  * FIXME: parameters unsafe
393  */
394 NTSTATUS WINAPI NtAdjustPrivilegesToken(
395         IN HANDLE32 TokenHandle,
396         IN BOOL32 DisableAllPrivileges,
397         IN PTOKEN_PRIVILEGES NewState,
398         IN DWORD BufferLength,
399         OUT PTOKEN_PRIVILEGES PreviousState,
400         OUT PDWORD ReturnLength)
401 {
402         FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,%p,%p),stub!\n",
403         TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength);
404         return 0;
405 }
406
407 /******************************************************************************
408  *  NtOpenProcessToken          [NTDLL] 
409  */
410 NTSTATUS WINAPI NtOpenProcessToken(DWORD x1,DWORD x2,DWORD x3) {
411         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3);
412         return 0;
413 }
414
415 /******************************************************************************
416  *  NtSetInformationThread              [NTDLL] 
417  */
418 NTSTATUS WINAPI NtSetInformationThread(
419         HANDLE32 ThreadHandle,
420         THREADINFOCLASS ThreadInformationClass,
421         PVOID ThreadInformation,
422         ULONG ThreadInformationLength)
423 {
424         FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx),stub!\n",
425         ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength);
426         return 0;
427 }
428
429 /******************************************************************************
430  *  NtOpenThreadToken           [NTDLL] 
431  */
432 NTSTATUS WINAPI NtOpenThreadToken(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
433         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx) stub\n",x1,x2,x3,x4);
434         return 0;
435 }
436
437 /******************************************************************************
438  *  NtSetVolumeInformationFile          [NTDLL] 
439  */
440 NTSTATUS WINAPI NtSetVolumeInformationFile(
441         IN HANDLE32 FileHandle,
442         IN PVOID VolumeInformationClass,
443         PVOID VolumeInformation,
444         ULONG Length) 
445 {
446         FIXME(ntdll,"(0x%08x,%p,%p,0x%08lx) stub\n",
447         FileHandle,VolumeInformationClass,VolumeInformation,Length);
448         return 0;
449 }
450
451 /******************************************************************************
452  *  NtCreatePort                [NTDLL] 
453  */
454 NTSTATUS WINAPI NtCreatePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) 
455 {
456         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5);
457         return 0;
458 }
459
460 /******************************************************************************
461  *  NtSetInformationFile                [NTDLL] 
462  */
463 NTSTATUS WINAPI NtSetInformationFile(
464         HANDLE32 FileHandle,
465         PIO_STATUS_BLOCK IoStatusBlock,
466         PVOID FileInformation,
467         ULONG Length,
468         FILE_INFORMATION_CLASS FileInformationClass)
469 {
470         FIXME(ntdll,"(0x%08x,%p,%p,0x%08lx,0x%08x)\n",
471         FileHandle,IoStatusBlock,FileInformation,Length,FileInformationClass);
472         return 0;
473 }
474
475 /******************************************************************************
476  *  NtSetEvent          [NTDLL] 
477  */
478 NTSTATUS WINAPI NtSetEvent(
479         IN HANDLE32 EventHandle,
480         PULONG NumberOfThreadsReleased)
481 {
482         FIXME(ntdll,"(0x%08x,%p)\n",
483         EventHandle, NumberOfThreadsReleased);
484         return 0;
485 }
486
487
488 /******************************************************************************
489  *  NtQueryInformationFile              [NTDLL] 
490  */
491 NTSTATUS WINAPI NtQueryInformationFile(
492         HANDLE32 FileHandle,
493         PIO_STATUS_BLOCK IoStatusBlock,
494         PVOID FileInformation,
495         ULONG Length,
496         FILE_INFORMATION_CLASS FileInformationClass)
497 {
498         FIXME(ntdll,"(0x%08x,%p,%p,0x%08lx,0x%08x),stub!\n",
499         FileHandle,IoStatusBlock,FileInformation,Length,FileInformationClass);
500         return 0;
501 }
502
503 /******************************************************************************
504  *  NtOpenEvent         [NTDLL] 
505  */
506 NTSTATUS WINAPI NtOpenEvent(
507         OUT PHANDLE EventHandle,
508         IN ACCESS_MASK DesiredAccess,
509         IN POBJECT_ATTRIBUTES ObjectAttributes)
510 {
511         FIXME(ntdll,"(%p,0x%08lx,%p(%s)),stub!\n",
512         EventHandle,DesiredAccess,ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer));
513         return 0;
514 }
515
516 /******************************************************************************
517  *  NtWaitForSingleObject               [NTDLL] 
518  */
519 NTSTATUS WINAPI NtWaitForSingleObject(
520         IN PHANDLE Object,
521         IN BOOLEAN Alertable,
522         IN PLARGE_INTEGER Time)
523 {
524         FIXME(ntdll,"(%p,0x%08x,%p),stub!\n",Object,Alertable,Time);
525         return 0;
526 }
527
528 /******************************************************************************
529  *  NtConnectPort               [NTDLL] 
530  */
531 NTSTATUS WINAPI NtConnectPort(DWORD x1,PUNICODE_STRING uni,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8) {
532         FIXME(ntdll,"(0x%08lx,%s,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,debugstr_w(uni->Buffer),x3,x4,x5,x6,x7,x8);
533         return 0;
534 }
535
536 /******************************************************************************
537  *  NtListenPort                [NTDLL] 
538  */
539 NTSTATUS WINAPI NtListenPort(DWORD x1,DWORD x2) {
540         FIXME(ntdll,"(0x%08lx,0x%08lx),stub!\n",x1,x2);
541         return 0;
542 }
543
544 /******************************************************************************
545  *  NtRequestWaitReplyPort              [NTDLL] 
546  */
547 NTSTATUS WINAPI NtRequestWaitReplyPort(DWORD x1,DWORD x2,DWORD x3) {
548         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3);
549         return 0;
550 }
551
552 /******************************************************************************
553  *  NtCreateDirectoryObject     [NTDLL] 
554  */
555 NTSTATUS WINAPI NtCreateDirectoryObject(
556         PHANDLE DirectoryHandle,
557         ACCESS_MASK DesiredAccess,
558         POBJECT_ATTRIBUTES ObjectAttributes) 
559 {
560         FIXME(ntdll,"(%p,0x%08lx,%p(%s)),stub!\n",
561         DirectoryHandle,DesiredAccess,ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer));
562         return 0;
563 }
564
565 /******************************************************************************
566  * NtMapViewOfSection   [NTDLL] 
567  * FUNCTION: Maps a view of a section into the virtual address space of a process
568  *
569  * ARGUMENTS:
570  *  SectionHandle       Handle of the section
571  *  ProcessHandle       Handle of the process
572  *  BaseAddress         Desired base address (or NULL) on entry
573  *                      Actual base address of the view on exit
574  *  ZeroBits            Number of high order address bits that must be zero
575  *  CommitSize          Size in bytes of the initially committed section of the view
576  *  SectionOffset       Offset in bytes from the beginning of the section to the beginning of the view
577  *  ViewSize            Desired length of map (or zero to map all) on entry 
578                         Actual length mapped on exit
579  *  InheritDisposition  Specified how the view is to be shared with
580  *                      child processes
581  *  AllocateType        Type of allocation for the pages
582  *  Protect             Protection for the committed region of the view
583  */
584 NTSTATUS WINAPI NtMapViewOfSection(
585         HANDLE32 SectionHandle,
586         HANDLE32 ProcessHandle,
587         PVOID* BaseAddress,
588         ULONG ZeroBits,
589         ULONG CommitSize,
590         PLARGE_INTEGER SectionOffset,
591         PULONG ViewSize,
592         SECTION_INHERIT InheritDisposition,
593         ULONG AllocationType,
594         ULONG Protect)
595 {
596         FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,0x%08lx,%p,%p,0x%08x,0x%08lx,0x%08lx) stub\n",
597         SectionHandle,ProcessHandle,BaseAddress,ZeroBits,CommitSize,SectionOffset,
598         ViewSize,InheritDisposition,AllocationType,Protect);
599         return 0;
600 }
601
602 /******************************************************************************
603  *  NtCreateMailSlotFile        [NTDLL] 
604  */
605 NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8) {
606         FIXME(ntdll,"(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);
607         return 0;
608 }
609
610 /******************************************************************************
611  *  NtReadFile/ZwReadFile                       [NTDLL] 
612  *
613  * Parameters
614  *   HANDLE32           FileHandle
615  *   HANDLE32           Event           OPTIONAL
616  *   PIO_APC_ROUTINE    ApcRoutine      OPTIONAL
617  *   PVOID              ApcContext      OPTIONAL
618  *   PIO_STATUS_BLOCK   IoStatusBlock
619  *   PVOID              Buffer
620  *   ULONG              Length
621  *   PLARGE_INTEGER     ByteOffset      OPTIONAL
622  *   PULONG             Key             OPTIONAL
623  */
624 NTSTATUS WINAPI NtReadFile (
625         HANDLE32 FileHandle,
626         HANDLE32 EventHandle,
627         PIO_APC_ROUTINE ApcRoutine,
628         PVOID ApcContext,
629         PIO_STATUS_BLOCK IoStatusBlock,
630         PVOID Buffer,
631         ULONG Length,
632         PLARGE_INTEGER ByteOffset,
633         PULONG Key)
634 {
635         FIXME(ntdll,"(0x%08x,0x%08x,%p,%p,%p,%p,0x%08lx,%p,%p),stub!\n",
636         FileHandle,EventHandle,ApcRoutine,ApcContext,IoStatusBlock,Buffer,Length,ByteOffset,Key);
637         return 0;
638 }
639
640
641 /******************************************************************************
642  *  NtCreateSection     [NTDLL] 
643  */
644 NTSTATUS WINAPI NtCreateSection(
645         OUT PHANDLE SectionHandle,
646         IN ACCESS_MASK DesiredAccess,
647         IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
648         IN PLARGE_INTEGER MaximumSize OPTIONAL,
649         IN ULONG SectionPageProtection OPTIONAL,
650         IN ULONG AllocationAttributes,
651         IN HANDLE32 FileHandle OPTIONAL)
652 {
653         FIXME(ntdll,"(%p,0x%08lx,%p(%s),%p,0x%08lx,0x%08lx,0x%08x) stub\n",
654         SectionHandle,DesiredAccess,ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer),
655         MaximumSize,SectionPageProtection,AllocationAttributes,FileHandle);
656         return 0;
657 }
658
659 /******************************************************************************
660  *  NtResumeThread      [NTDLL] 
661  */
662 NTSTATUS WINAPI NtResumeThread(
663         IN HANDLE32 ThreadHandle,
664         IN PULONG SuspendCount) 
665 {
666         FIXME(ntdll,"(0x%08x,%p),stub!\n",
667         ThreadHandle,SuspendCount);
668         return 0;
669 }
670
671 /******************************************************************************
672  *  NtReplyWaitReceivePort      [NTDLL] 
673  */
674 NTSTATUS WINAPI NtReplyWaitReceivePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
675         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4);
676         return 0;
677 }
678
679 /******************************************************************************
680  *  NtAcceptConnectPort [NTDLL] 
681  */
682 NTSTATUS WINAPI NtAcceptConnectPort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6) {
683         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6);
684         return 0;
685 }
686
687 /******************************************************************************
688  *  NtCompleteConnectPort       [NTDLL] 
689  */
690 NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1) {
691         FIXME(ntdll,"(0x%08lx),stub!\n",x1);
692         return 0;
693 }
694
695 /******************************************************************************
696  *  NtRegisterThreadTerminatePort       [NTDLL] 
697  */
698 NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1) {
699         FIXME(ntdll,"(0x%08lx),stub!\n",x1);
700         return 0;
701 }
702
703 /******************************************************************************
704  *  NtTerminateThread   [NTDLL] 
705  */
706 NTSTATUS WINAPI NtTerminateThread(
707         IN HANDLE32 ThreadHandle,
708         IN NTSTATUS ExitStatus)
709 {
710         BOOL32  ret = TerminateThread(ThreadHandle,ExitStatus);
711
712         if (ret)
713                 return 0;
714         return 0xc0000000; /* FIXME: lasterror->ntstatus */
715 }
716
717 /******************************************************************************
718  *  NtSetIntervalProfile        [NTDLL] 
719  */
720 NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,DWORD x2) {
721         FIXME(ntdll,"(0x%08lx,0x%08lx),stub!\n",x1,x2);
722         return 0;
723 }
724
725 /******************************************************************************
726  *  NtOpenSection       [NTDLL] 
727  */
728 NTSTATUS WINAPI NtOpenSection(
729         PHANDLE SectionHandle,
730         ACCESS_MASK DesiredAccess,
731         POBJECT_ATTRIBUTES ObjectAttributes)
732 {
733         FIXME(ntdll,"(%p,0x%08lx,%p(%s)),stub!\n",
734         SectionHandle,DesiredAccess,ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer));
735         return 0;
736 }
737 /******************************************************************************
738  *  NtQueryPerformanceCounter   [NTDLL] 
739  */
740 BOOL32 WINAPI NtQueryPerformanceCounter(
741         IN PLARGE_INTEGER Counter,
742         IN PLARGE_INTEGER Frequency) 
743 {
744         FIXME(ntdll,"(%p, 0%p) stub\n",
745         Counter, Frequency);
746         return 0;
747 }
748 /******************************************************************************
749  *  NtQuerySection      [NTDLL] 
750  */
751 NTSTATUS WINAPI NtQuerySection(
752         IN HANDLE32 SectionHandle,
753         IN PVOID SectionInformationClass,
754         OUT PVOID SectionInformation,
755         IN ULONG Length,
756         OUT PULONG ResultLength)
757 {
758         FIXME(ntdll,"(0x%08x,%p,%p,0x%08lx,%p) stub!\n",
759         SectionHandle,SectionInformationClass,SectionInformation,Length,ResultLength);
760         return 0;
761 }
762
763 /******************************************************************************
764  *  NtQuerySecurityObject       [NTDLL] 
765  */
766 NTSTATUS WINAPI NtQuerySecurityObject(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) {
767         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx) stub!\n",x1,x2,x3,x4,x5);
768         return 0;
769 }
770 /******************************************************************************
771  *  NtCreateSemaphore   [NTDLL] 
772  */
773 NTSTATUS WINAPI NtCreateSemaphore(
774         OUT PHANDLE SemaphoreHandle,
775         IN ACCESS_MASK DesiredAccess,
776         IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
777         IN ULONG InitialCount,
778         IN ULONG MaximumCount) 
779 {
780         FIXME(ntdll,"(%p,0x%08lx,%p(%s),0x%08lx,0x%08lx) stub!\n",
781         SemaphoreHandle, DesiredAccess, ObjectAttributes, debugstr_w(ObjectAttributes->ObjectName->Buffer),
782         InitialCount, MaximumCount);
783         return 0;
784 }
785 /******************************************************************************
786  *  NtOpenSemaphore     [NTDLL] 
787  */
788 NTSTATUS WINAPI NtOpenSemaphore(
789         IN HANDLE32 SemaphoreHandle,
790         IN ACCESS_MASK DesiredAcces,
791         IN POBJECT_ATTRIBUTES ObjectAttributes)
792 {
793         FIXME(ntdll,"(0x%08x,0x%08lx,%p(%s)) stub!\n",
794         SemaphoreHandle, DesiredAcces, ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer));
795         return 0;
796 }
797
798 /******************************************************************************
799  *  NtQuerySemaphore    [NTDLL] 
800  */
801 NTSTATUS WINAPI NtQuerySemaphore(
802         HANDLE32 SemaphoreHandle,
803         PVOID SemaphoreInformationClass,
804         OUT PVOID SemaphoreInformation,
805         ULONG Length,
806         PULONG ReturnLength) 
807 {
808         FIXME(ntdll,"(0x%08x,%p,%p,0x%08lx,%p) stub!\n",
809         SemaphoreHandle, SemaphoreInformationClass, SemaphoreInformation, Length, ReturnLength);
810         return 0;
811 }
812 /******************************************************************************
813  *  NtQuerySemaphore    [NTDLL] 
814  */
815 NTSTATUS WINAPI NtReleaseSemaphore(
816         IN HANDLE32 SemaphoreHandle,
817         IN ULONG ReleaseCount,
818         IN PULONG PreviousCount)
819 {
820         FIXME(ntdll,"(0x%08x,0x%08lx,%p,) stub!\n",
821         SemaphoreHandle, ReleaseCount, PreviousCount);
822         return 0;
823 }
824
825 /******************************************************************************
826  *  NtCreateSymbolicLinkObject  [NTDLL] 
827  */
828 NTSTATUS WINAPI NtCreateSymbolicLinkObject(
829         OUT PHANDLE SymbolicLinkHandle,
830         IN ACCESS_MASK DesiredAccess,
831         IN POBJECT_ATTRIBUTES ObjectAttributes,
832         IN PUNICODE_STRING Name)
833 {
834         FIXME(ntdll,"(%p,0x%08lx,%p(%s), %p) stub\n",
835         SymbolicLinkHandle, DesiredAccess, ObjectAttributes, debugstr_w(ObjectAttributes->ObjectName->Buffer), Name);
836         return 0;
837 }
838
839 /******************************************************************************
840  *  NtOpenSymbolicLinkObject    [NTDLL] 
841  */
842 NTSTATUS WINAPI NtOpenSymbolicLinkObject(
843         OUT PHANDLE LinkHandle,
844         IN ACCESS_MASK DesiredAccess,
845         IN POBJECT_ATTRIBUTES ObjectAttributes)
846 {
847         FIXME(ntdll,"(%p,0x%08lx,%p(%s)) stub\n",
848         LinkHandle, DesiredAccess, ObjectAttributes,debugstr_w(ObjectAttributes->ObjectName->Buffer));
849         return 0;
850 }
851 /******************************************************************************
852  *  NtQuerySymbolicLinkObject   [NTDLL] 
853  */
854 NTSTATUS NtQuerySymbolicLinkObject(
855         IN HANDLE32 LinkHandle,
856         IN OUT PUNICODE_STRING LinkTarget,
857         OUT PULONG ReturnedLength OPTIONAL)
858 {
859         FIXME(ntdll,"(0x%08x,%p,%p) stub\n",
860         LinkHandle, LinkTarget, ReturnedLength);
861
862         return 0;
863 }