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)
7 * Copyright 1996-1998 Marcus Meissner
18 DEFAULT_DEBUG_CHANNEL(ntdll)
20 /* move to winbase.h */
21 typedef VOID (CALLBACK *PTIMERAPCROUTINE)(LPVOID lpArgToCompletionRoutine,DWORD dwTimerLowValue,DWORD dwTimerHighValue);
27 /**************************************************************************
28 * NtCreateTimer [NTDLL.87]
30 NTSTATUS WINAPI NtCreateTimer(
31 OUT PHANDLE TimerHandle,
32 IN ACCESS_MASK DesiredAccess,
33 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
34 IN TIMER_TYPE TimerType)
36 FIXME(ntdll,"(%p,0x%08lx,%p(%s),0x%08x) stub\n",
37 TimerHandle,DesiredAccess,ObjectAttributes,
38 ObjectAttributes ? debugstr_w(ObjectAttributes->ObjectName->Buffer) : NULL,
42 /**************************************************************************
43 * NtSetTimer [NTDLL.221]
45 NTSTATUS WINAPI NtSetTimer(
46 IN HANDLE TimerHandle,
47 IN PLARGE_INTEGER DueTime,
48 IN PTIMERAPCROUTINE TimerApcRoutine,
49 IN PVOID TimerContext,
51 IN ULONG Period OPTIONAL,
52 OUT PBOOLEAN PreviousState OPTIONAL)
54 FIXME(ntdll,"(0x%08x,%p,%p,%p,%08x,0x%08lx,%p) stub\n",
55 TimerHandle,DueTime,TimerApcRoutine,TimerContext,WakeTimer,Period,PreviousState);
59 /******************************************************************************
60 * NtQueryTimerResolution [NTDLL.129]
62 NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3)
64 FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx), stub!\n",x1,x2,x3);
72 /******************************************************************************
73 * NtTerminateProcess [NTDLL.]
75 * Native applications must kill themselves when done
76 * FIXME: return value 0-success
78 NTSTATUS WINAPI NtTerminateProcess(
82 TRACE(ntdll, "0x%08x 0x%08lx\n", ProcessHandle, ExitStatus );
84 /* win32 (0x7fffffff) to nt (-1) */
85 if ( NtCurrentProcess() == ProcessHandle )
86 ProcessHandle = GetCurrentProcess();
88 return (! TerminateProcess( ProcessHandle, ExitStatus ));
91 /******************************************************************************
92 * NtQueryInformationProcess [NTDLL.]
95 NTSTATUS WINAPI NtQueryInformationProcess(
96 IN HANDLE ProcessHandle,
97 IN PROCESSINFOCLASS ProcessInformationClass,
98 OUT PVOID ProcessInformation,
99 IN ULONG ProcessInformationLength,
100 OUT PULONG ReturnLength)
102 FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
103 ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength,ReturnLength);
107 /******************************************************************************
108 * NtSetInformationProcess [NTDLL.207]
110 NTSTATUS WINAPI NtSetInformationProcess(
111 IN HANDLE ProcessHandle,
112 IN PROCESSINFOCLASS ProcessInformationClass,
113 IN PVOID ProcessInformation,
114 IN ULONG ProcessInformationLength)
116 FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx) stub\n",
117 ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength);
125 /******************************************************************************
126 * NtResumeThread [NTDLL]
128 NTSTATUS WINAPI NtResumeThread(
129 IN HANDLE ThreadHandle,
130 IN PULONG SuspendCount)
132 FIXME(ntdll,"(0x%08x,%p),stub!\n",
133 ThreadHandle,SuspendCount);
137 /******************************************************************************
138 * NtTerminateThread [NTDLL]
140 NTSTATUS WINAPI NtTerminateThread(
141 IN HANDLE ThreadHandle,
142 IN NTSTATUS ExitStatus)
144 if ( TerminateThread(ThreadHandle,ExitStatus) )
147 return 0xc0000000; /* FIXME: lasterror->ntstatus */
150 /******************************************************************************
151 * NtQueryInformationThread [NTDLL.]
154 NTSTATUS WINAPI NtQueryInformationThread(
155 IN HANDLE ThreadHandle,
156 IN THREADINFOCLASS ThreadInformationClass,
157 OUT PVOID ThreadInformation,
158 IN ULONG ThreadInformationLength,
159 OUT PULONG ReturnLength)
161 FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
162 ThreadHandle, ThreadInformationClass, ThreadInformation,
163 ThreadInformationLength, ReturnLength);
167 /******************************************************************************
168 * NtSetInformationThread [NTDLL]
170 NTSTATUS WINAPI NtSetInformationThread(
172 THREADINFOCLASS ThreadInformationClass,
173 PVOID ThreadInformation,
174 ULONG ThreadInformationLength)
176 FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx),stub!\n",
177 ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength);
185 /******************************************************************************
186 * NtDuplicateToken [NTDLL]
188 NTSTATUS WINAPI NtDuplicateToken(
189 IN HANDLE ExistingToken,
190 IN ACCESS_MASK DesiredAccess,
191 IN POBJECT_ATTRIBUTES ObjectAttributes,
192 IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
193 IN TOKEN_TYPE TokenType,
194 OUT PHANDLE NewToken)
196 FIXME(ntdll,"(0x%08x,0x%08lx,%p,0x%08x,0x%08x,%p),stub!\n",
197 ExistingToken, DesiredAccess, ObjectAttributes, ImpersonationLevel,
198 TokenType, NewToken);
202 /******************************************************************************
203 * NtOpenProcessToken [NTDLL]
205 NTSTATUS WINAPI NtOpenProcessToken(
206 HANDLE ProcessHandle,
210 FIXME(ntdll,"(0x%08x,0x%08lx,%p): stub\n",
211 ProcessHandle,DesiredAccess, TokenHandle);
212 *TokenHandle = 0xcafe;
216 /******************************************************************************
217 * NtOpenThreadToken [NTDLL]
219 NTSTATUS WINAPI NtOpenThreadToken(
225 FIXME(ntdll,"(0x%08x,0x%08lx,0x%08x,%p): stub\n",
226 ThreadHandle,DesiredAccess, OpenAsSelf, TokenHandle);
227 *TokenHandle = 0xcafe;
231 /******************************************************************************
232 * NtAdjustPrivilegesToken [NTDLL]
234 * FIXME: parameters unsafe
236 NTSTATUS WINAPI NtAdjustPrivilegesToken(
237 IN HANDLE TokenHandle,
238 IN BOOLEAN DisableAllPrivileges,
239 IN PTOKEN_PRIVILEGES NewState,
240 IN DWORD BufferLength,
241 OUT PTOKEN_PRIVILEGES PreviousState,
242 OUT PDWORD ReturnLength)
244 FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,%p,%p),stub!\n",
245 TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength);
249 /******************************************************************************
250 * NtQueryInformationToken [NTDLL.156]
253 NTSTATUS WINAPI NtQueryInformationToken(
255 DWORD tokeninfoclass,
257 DWORD tokeninfolength,
260 FIXME(ntdll,"(%08x,%ld,%p,%ld,%p): stub\n",
261 token,tokeninfoclass,tokeninfo,tokeninfolength,retlen);
263 switch (tokeninfoclass)
264 { case TokenGroups: /* 2 */
265 *retlen = sizeof (TOKEN_GROUPS);
267 case TokenUser: /* 1 */
268 case TokenPrivileges:
270 case TokenPrimaryGroup:
271 case TokenDefaultDacl:
274 case TokenImpersonationLevel:
275 case TokenStatistics:
286 /******************************************************************************
287 * NtCreateSection [NTDLL]
289 NTSTATUS WINAPI NtCreateSection(
290 OUT PHANDLE SectionHandle,
291 IN ACCESS_MASK DesiredAccess,
292 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
293 IN PLARGE_INTEGER MaximumSize OPTIONAL,
294 IN ULONG SectionPageProtection OPTIONAL,
295 IN ULONG AllocationAttributes,
296 IN HANDLE FileHandle OPTIONAL)
298 FIXME(ntdll,"(%p,0x%08lx,%p(%s),%p,0x%08lx,0x%08lx,0x%08x) stub\n",
299 SectionHandle,DesiredAccess,ObjectAttributes,
300 ObjectAttributes ? debugstr_w(ObjectAttributes->ObjectName->Buffer) : NULL,
301 MaximumSize,SectionPageProtection,AllocationAttributes,FileHandle);
305 /******************************************************************************
306 * NtOpenSection [NTDLL]
308 NTSTATUS WINAPI NtOpenSection(
309 PHANDLE SectionHandle,
310 ACCESS_MASK DesiredAccess,
311 POBJECT_ATTRIBUTES ObjectAttributes)
313 FIXME(ntdll,"(%p,0x%08lx,%p(%s)),stub!\n",
314 SectionHandle,DesiredAccess,ObjectAttributes,
315 ObjectAttributes ? debugstr_w(ObjectAttributes->ObjectName->Buffer) : NULL);
319 /******************************************************************************
320 * NtQuerySection [NTDLL]
322 NTSTATUS WINAPI NtQuerySection(
323 IN HANDLE SectionHandle,
324 IN PVOID SectionInformationClass,
325 OUT PVOID SectionInformation,
327 OUT PULONG ResultLength)
329 FIXME(ntdll,"(0x%08x,%p,%p,0x%08lx,%p) stub!\n",
330 SectionHandle,SectionInformationClass,SectionInformation,Length,ResultLength);
334 /******************************************************************************
335 * NtMapViewOfSection [NTDLL]
336 * FUNCTION: Maps a view of a section into the virtual address space of a process
339 * SectionHandle Handle of the section
340 * ProcessHandle Handle of the process
341 * BaseAddress Desired base address (or NULL) on entry
342 * Actual base address of the view on exit
343 * ZeroBits Number of high order address bits that must be zero
344 * CommitSize Size in bytes of the initially committed section of the view
345 * SectionOffset Offset in bytes from the beginning of the section to the beginning of the view
346 * ViewSize Desired length of map (or zero to map all) on entry
347 Actual length mapped on exit
348 * InheritDisposition Specified how the view is to be shared with
350 * AllocateType Type of allocation for the pages
351 * Protect Protection for the committed region of the view
353 NTSTATUS WINAPI NtMapViewOfSection(
354 HANDLE SectionHandle,
355 HANDLE ProcessHandle,
359 PLARGE_INTEGER SectionOffset,
361 SECTION_INHERIT InheritDisposition,
362 ULONG AllocationType,
365 FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,0x%08lx,%p,%p,0x%08x,0x%08lx,0x%08lx) stub\n",
366 SectionHandle,ProcessHandle,BaseAddress,ZeroBits,CommitSize,SectionOffset,
367 ViewSize,InheritDisposition,AllocationType,Protect);
375 /******************************************************************************
376 * NtCreatePort [NTDLL]
378 NTSTATUS WINAPI NtCreatePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5)
380 FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5);
384 /******************************************************************************
385 * NtConnectPort [NTDLL]
387 NTSTATUS WINAPI NtConnectPort(DWORD x1,PUNICODE_STRING uni,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8)
389 FIXME(ntdll,"(0x%08lx,%s,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",
390 x1,debugstr_w(uni->Buffer),x3,x4,x5,x6,x7,x8);
394 /******************************************************************************
395 * NtListenPort [NTDLL]
397 NTSTATUS WINAPI NtListenPort(DWORD x1,DWORD x2)
399 FIXME(ntdll,"(0x%08lx,0x%08lx),stub!\n",x1,x2);
403 /******************************************************************************
404 * NtAcceptConnectPort [NTDLL]
406 NTSTATUS WINAPI NtAcceptConnectPort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6)
408 FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6);
412 /******************************************************************************
413 * NtCompleteConnectPort [NTDLL]
415 NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1)
417 FIXME(ntdll,"(0x%08lx),stub!\n",x1);
421 /******************************************************************************
422 * NtRegisterThreadTerminatePort [NTDLL]
424 NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1)
426 FIXME(ntdll,"(0x%08lx),stub!\n",x1);
430 /******************************************************************************
431 * NtRequestWaitReplyPort [NTDLL]
433 NTSTATUS WINAPI NtRequestWaitReplyPort(DWORD x1,DWORD x2,DWORD x3)
435 FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3);
439 /******************************************************************************
440 * NtReplyWaitReceivePort [NTDLL]
442 NTSTATUS WINAPI NtReplyWaitReceivePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4)
444 FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4);
452 /******************************************************************************
453 * NtSetIntervalProfile [NTDLL]
455 NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,DWORD x2) {
456 FIXME(ntdll,"(0x%08lx,0x%08lx),stub!\n",x1,x2);
460 /******************************************************************************
461 * NtQueryPerformanceCounter [NTDLL]
463 NTSTATUS WINAPI NtQueryPerformanceCounter(
464 IN PLARGE_INTEGER Counter,
465 IN PLARGE_INTEGER Frequency)
467 FIXME(ntdll,"(%p, 0%p) stub\n",
472 /******************************************************************************
473 * NtCreateMailSlotFile [NTDLL]
475 NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8)
477 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);
481 /******************************************************************************
482 * NtQuerySystemInformation [NTDLL.168]
485 * SystemInformationClass Index to a certain information structure
486 * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
487 * SystemCacheInformation SYSTEM_CACHE_INFORMATION
488 * SystemConfigurationInformation CONFIGURATION_INFORMATION
489 * observed (class/len):
494 * SystemInformation caller supplies storage for the information structure
495 * Length size of the structure
496 * ResultLength Data written
498 NTSTATUS WINAPI NtQuerySystemInformation(
499 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
500 OUT PVOID SystemInformation,
502 OUT PULONG ResultLength)
504 FIXME(ntdll,"(0x%08x,%p,0x%08lx,%p) stub\n",
505 SystemInformationClass,SystemInformation,Length,ResultLength);
506 ZeroMemory (SystemInformation, Length);
511 /******************************************************************************
512 * NtCreatePagingFile [NTDLL]
514 NTSTATUS WINAPI NtCreatePagingFile(
515 IN PUNICODE_STRING PageFileName,
518 OUT PULONG ActualSize)
520 FIXME(ntdll,"(%p(%s),0x%08lx,0x%08lx,%p),stub!\n",
521 PageFileName->Buffer, debugstr_w(PageFileName->Buffer),MiniumSize,MaxiumSize,ActualSize);
525 /******************************************************************************
526 * NtDisplayString [NTDLL.95]
528 * writes a string to the nt-textmode screen eg. during startup
530 NTSTATUS WINAPI NtDisplayString (
531 PUNICODE_STRING string)
533 TRACE(ntdll,"%p(%s)\n",string->Buffer, debugstr_w(string->Buffer));
534 WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), string->Buffer, string->Length, 0, 0);