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
15 #include "debugtools.h"
19 DEFAULT_DEBUG_CHANNEL(ntdll
)
25 /**************************************************************************
26 * NtCreateTimer [NTDLL.87]
28 NTSTATUS WINAPI
NtCreateTimer(
29 OUT PHANDLE TimerHandle
,
30 IN ACCESS_MASK DesiredAccess
,
31 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL
,
32 IN TIMER_TYPE TimerType
)
34 FIXME("(%p,0x%08lx,%p(%s),0x%08x) stub\n",
35 TimerHandle
,DesiredAccess
,ObjectAttributes
,
36 ObjectAttributes
? debugstr_w(ObjectAttributes
->ObjectName
->Buffer
) : NULL
,
40 /**************************************************************************
41 * NtSetTimer [NTDLL.221]
43 NTSTATUS WINAPI
NtSetTimer(
44 IN HANDLE TimerHandle
,
45 IN PLARGE_INTEGER DueTime
,
46 IN PTIMERAPCROUTINE TimerApcRoutine
,
47 IN PVOID TimerContext
,
49 IN ULONG Period OPTIONAL
,
50 OUT PBOOLEAN PreviousState OPTIONAL
)
52 FIXME("(0x%08x,%p,%p,%p,%08x,0x%08lx,%p) stub\n",
53 TimerHandle
,DueTime
,TimerApcRoutine
,TimerContext
,WakeTimer
,Period
,PreviousState
);
57 /******************************************************************************
58 * NtQueryTimerResolution [NTDLL.129]
60 NTSTATUS WINAPI
NtQueryTimerResolution(DWORD x1
,DWORD x2
,DWORD x3
)
62 FIXME("(0x%08lx,0x%08lx,0x%08lx), stub!\n",x1
,x2
,x3
);
70 /******************************************************************************
71 * NtTerminateProcess [NTDLL.]
73 * Native applications must kill themselves when done
74 * FIXME: return value 0-success
76 NTSTATUS WINAPI
NtTerminateProcess(
80 TRACE("0x%08x 0x%08lx\n", ProcessHandle
, ExitStatus
);
82 /* win32 (0x7fffffff) to nt (-1) */
83 if ( NtCurrentProcess() == ProcessHandle
)
84 ProcessHandle
= GetCurrentProcess();
86 return (! TerminateProcess( ProcessHandle
, ExitStatus
));
89 /******************************************************************************
90 * NtQueryInformationProcess [NTDLL.]
93 NTSTATUS WINAPI
NtQueryInformationProcess(
94 IN HANDLE ProcessHandle
,
95 IN PROCESSINFOCLASS ProcessInformationClass
,
96 OUT PVOID ProcessInformation
,
97 IN ULONG ProcessInformationLength
,
98 OUT PULONG ReturnLength
)
100 FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
101 ProcessHandle
,ProcessInformationClass
,ProcessInformation
,ProcessInformationLength
,ReturnLength
);
105 /******************************************************************************
106 * NtSetInformationProcess [NTDLL.207]
108 NTSTATUS WINAPI
NtSetInformationProcess(
109 IN HANDLE ProcessHandle
,
110 IN PROCESSINFOCLASS ProcessInformationClass
,
111 IN PVOID ProcessInformation
,
112 IN ULONG ProcessInformationLength
)
114 FIXME("(0x%08x,0x%08x,%p,0x%08lx) stub\n",
115 ProcessHandle
,ProcessInformationClass
,ProcessInformation
,ProcessInformationLength
);
123 /******************************************************************************
124 * NtResumeThread [NTDLL]
126 NTSTATUS WINAPI
NtResumeThread(
127 IN HANDLE ThreadHandle
,
128 IN PULONG SuspendCount
)
130 FIXME("(0x%08x,%p),stub!\n",
131 ThreadHandle
,SuspendCount
);
135 /******************************************************************************
136 * NtTerminateThread [NTDLL]
138 NTSTATUS WINAPI
NtTerminateThread(
139 IN HANDLE ThreadHandle
,
140 IN NTSTATUS ExitStatus
)
142 if ( TerminateThread(ThreadHandle
,ExitStatus
) )
145 return 0xc0000000; /* FIXME: lasterror->ntstatus */
148 /******************************************************************************
149 * NtQueryInformationThread [NTDLL.]
152 NTSTATUS WINAPI
NtQueryInformationThread(
153 IN HANDLE ThreadHandle
,
154 IN THREADINFOCLASS ThreadInformationClass
,
155 OUT PVOID ThreadInformation
,
156 IN ULONG ThreadInformationLength
,
157 OUT PULONG ReturnLength
)
159 FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
160 ThreadHandle
, ThreadInformationClass
, ThreadInformation
,
161 ThreadInformationLength
, ReturnLength
);
165 /******************************************************************************
166 * NtSetInformationThread [NTDLL]
168 NTSTATUS WINAPI
NtSetInformationThread(
170 THREADINFOCLASS ThreadInformationClass
,
171 PVOID ThreadInformation
,
172 ULONG ThreadInformationLength
)
174 FIXME("(0x%08x,0x%08x,%p,0x%08lx),stub!\n",
175 ThreadHandle
, ThreadInformationClass
, ThreadInformation
, ThreadInformationLength
);
183 /******************************************************************************
184 * NtDuplicateToken [NTDLL]
186 NTSTATUS WINAPI
NtDuplicateToken(
187 IN HANDLE ExistingToken
,
188 IN ACCESS_MASK DesiredAccess
,
189 IN POBJECT_ATTRIBUTES ObjectAttributes
,
190 IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
,
191 IN TOKEN_TYPE TokenType
,
192 OUT PHANDLE NewToken
)
194 FIXME("(0x%08x,0x%08lx,%p,0x%08x,0x%08x,%p),stub!\n",
195 ExistingToken
, DesiredAccess
, ObjectAttributes
, ImpersonationLevel
,
196 TokenType
, NewToken
);
200 /******************************************************************************
201 * NtOpenProcessToken [NTDLL]
203 NTSTATUS WINAPI
NtOpenProcessToken(
204 HANDLE ProcessHandle
,
208 FIXME("(0x%08x,0x%08lx,%p): stub\n",
209 ProcessHandle
,DesiredAccess
, TokenHandle
);
210 *TokenHandle
= 0xcafe;
214 /******************************************************************************
215 * NtOpenThreadToken [NTDLL]
217 NTSTATUS WINAPI
NtOpenThreadToken(
223 FIXME("(0x%08x,0x%08lx,0x%08x,%p): stub\n",
224 ThreadHandle
,DesiredAccess
, OpenAsSelf
, TokenHandle
);
225 *TokenHandle
= 0xcafe;
229 /******************************************************************************
230 * NtAdjustPrivilegesToken [NTDLL]
232 * FIXME: parameters unsafe
234 NTSTATUS WINAPI
NtAdjustPrivilegesToken(
235 IN HANDLE TokenHandle
,
236 IN BOOLEAN DisableAllPrivileges
,
237 IN PTOKEN_PRIVILEGES NewState
,
238 IN DWORD BufferLength
,
239 OUT PTOKEN_PRIVILEGES PreviousState
,
240 OUT PDWORD ReturnLength
)
242 FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p,%p),stub!\n",
243 TokenHandle
, DisableAllPrivileges
, NewState
, BufferLength
, PreviousState
, ReturnLength
);
247 /******************************************************************************
248 * NtQueryInformationToken [NTDLL.156]
251 NTSTATUS WINAPI
NtQueryInformationToken(
253 DWORD tokeninfoclass
,
255 DWORD tokeninfolength
,
258 FIXME("(%08x,%ld,%p,%ld,%p): stub\n",
259 token
,tokeninfoclass
,tokeninfo
,tokeninfolength
,retlen
);
261 switch (tokeninfoclass
)
262 { case TokenGroups
: /* 2 */
263 *retlen
= sizeof (TOKEN_GROUPS
);
265 case TokenUser
: /* 1 */
266 *retlen
= sizeof (TOKEN_USER
);
268 case TokenPrivileges
:
269 *retlen
= sizeof (TOKEN_PRIVILEGES
);
272 *retlen
= sizeof (TOKEN_OWNER
);
274 case TokenPrimaryGroup
:
275 *retlen
= sizeof (TOKEN_PRIMARY_GROUP
);
277 case TokenDefaultDacl
:
278 *retlen
= sizeof (TOKEN_DEFAULT_DACL
);
281 *retlen
= sizeof (TOKEN_SOURCE
);
284 *retlen
= sizeof (TOKEN_TYPE
);
287 case TokenImpersonationLevel
:
288 case TokenStatistics
:
299 /******************************************************************************
300 * NtCreateSection [NTDLL]
302 NTSTATUS WINAPI
NtCreateSection(
303 OUT PHANDLE SectionHandle
,
304 IN ACCESS_MASK DesiredAccess
,
305 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL
,
306 IN PLARGE_INTEGER MaximumSize OPTIONAL
,
307 IN ULONG SectionPageProtection OPTIONAL
,
308 IN ULONG AllocationAttributes
,
309 IN HANDLE FileHandle OPTIONAL
)
311 FIXME("(%p,0x%08lx,%p(%s),%p,0x%08lx,0x%08lx,0x%08x) stub\n",
312 SectionHandle
,DesiredAccess
,ObjectAttributes
,
313 ObjectAttributes
? debugstr_w(ObjectAttributes
->ObjectName
->Buffer
) : NULL
,
314 MaximumSize
,SectionPageProtection
,AllocationAttributes
,FileHandle
);
318 /******************************************************************************
319 * NtOpenSection [NTDLL]
321 NTSTATUS WINAPI
NtOpenSection(
322 PHANDLE SectionHandle
,
323 ACCESS_MASK DesiredAccess
,
324 POBJECT_ATTRIBUTES ObjectAttributes
)
326 FIXME("(%p,0x%08lx,%p(%s)),stub!\n",
327 SectionHandle
,DesiredAccess
,ObjectAttributes
,
328 ObjectAttributes
? debugstr_w(ObjectAttributes
->ObjectName
->Buffer
) : NULL
);
332 /******************************************************************************
333 * NtQuerySection [NTDLL]
335 NTSTATUS WINAPI
NtQuerySection(
336 IN HANDLE SectionHandle
,
337 IN PVOID SectionInformationClass
,
338 OUT PVOID SectionInformation
,
340 OUT PULONG ResultLength
)
342 FIXME("(0x%08x,%p,%p,0x%08lx,%p) stub!\n",
343 SectionHandle
,SectionInformationClass
,SectionInformation
,Length
,ResultLength
);
347 /******************************************************************************
348 * NtMapViewOfSection [NTDLL]
349 * FUNCTION: Maps a view of a section into the virtual address space of a process
352 * SectionHandle Handle of the section
353 * ProcessHandle Handle of the process
354 * BaseAddress Desired base address (or NULL) on entry
355 * Actual base address of the view on exit
356 * ZeroBits Number of high order address bits that must be zero
357 * CommitSize Size in bytes of the initially committed section of the view
358 * SectionOffset Offset in bytes from the beginning of the section to the beginning of the view
359 * ViewSize Desired length of map (or zero to map all) on entry
360 Actual length mapped on exit
361 * InheritDisposition Specified how the view is to be shared with
363 * AllocateType Type of allocation for the pages
364 * Protect Protection for the committed region of the view
366 NTSTATUS WINAPI
NtMapViewOfSection(
367 HANDLE SectionHandle
,
368 HANDLE ProcessHandle
,
372 PLARGE_INTEGER SectionOffset
,
374 SECTION_INHERIT InheritDisposition
,
375 ULONG AllocationType
,
378 FIXME("(0x%08x,0x%08x,%p,0x%08lx,0x%08lx,%p,%p,0x%08x,0x%08lx,0x%08lx) stub\n",
379 SectionHandle
,ProcessHandle
,BaseAddress
,ZeroBits
,CommitSize
,SectionOffset
,
380 ViewSize
,InheritDisposition
,AllocationType
,Protect
);
388 /******************************************************************************
389 * NtCreatePort [NTDLL]
391 NTSTATUS WINAPI
NtCreatePort(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
,DWORD x5
)
393 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1
,x2
,x3
,x4
,x5
);
397 /******************************************************************************
398 * NtConnectPort [NTDLL]
400 NTSTATUS WINAPI
NtConnectPort(DWORD x1
,PUNICODE_STRING uni
,DWORD x3
,DWORD x4
,DWORD x5
,DWORD x6
,DWORD x7
,DWORD x8
)
402 FIXME("(0x%08lx,%s,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",
403 x1
,debugstr_w(uni
->Buffer
),x3
,x4
,x5
,x6
,x7
,x8
);
407 /******************************************************************************
408 * NtListenPort [NTDLL]
410 NTSTATUS WINAPI
NtListenPort(DWORD x1
,DWORD x2
)
412 FIXME("(0x%08lx,0x%08lx),stub!\n",x1
,x2
);
416 /******************************************************************************
417 * NtAcceptConnectPort [NTDLL]
419 NTSTATUS WINAPI
NtAcceptConnectPort(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
,DWORD x5
,DWORD x6
)
421 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1
,x2
,x3
,x4
,x5
,x6
);
425 /******************************************************************************
426 * NtCompleteConnectPort [NTDLL]
428 NTSTATUS WINAPI
NtCompleteConnectPort(DWORD x1
)
430 FIXME("(0x%08lx),stub!\n",x1
);
434 /******************************************************************************
435 * NtRegisterThreadTerminatePort [NTDLL]
437 NTSTATUS WINAPI
NtRegisterThreadTerminatePort(DWORD x1
)
439 FIXME("(0x%08lx),stub!\n",x1
);
443 /******************************************************************************
444 * NtRequestWaitReplyPort [NTDLL]
446 NTSTATUS WINAPI
NtRequestWaitReplyPort(DWORD x1
,DWORD x2
,DWORD x3
)
448 FIXME("(0x%08lx,0x%08lx,0x%08lx),stub!\n",x1
,x2
,x3
);
452 /******************************************************************************
453 * NtReplyWaitReceivePort [NTDLL]
455 NTSTATUS WINAPI
NtReplyWaitReceivePort(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
)
457 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1
,x2
,x3
,x4
);
465 /******************************************************************************
466 * NtSetIntervalProfile [NTDLL]
468 NTSTATUS WINAPI
NtSetIntervalProfile(DWORD x1
,DWORD x2
) {
469 FIXME("(0x%08lx,0x%08lx),stub!\n",x1
,x2
);
473 /******************************************************************************
474 * NtQueryPerformanceCounter [NTDLL]
476 NTSTATUS WINAPI
NtQueryPerformanceCounter(
477 IN PLARGE_INTEGER Counter
,
478 IN PLARGE_INTEGER Frequency
)
480 FIXME("(%p, 0%p) stub\n",
485 /******************************************************************************
486 * NtCreateMailSlotFile [NTDLL]
488 NTSTATUS WINAPI
NtCreateMailslotFile(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
,DWORD x5
,DWORD x6
,DWORD x7
,DWORD x8
)
490 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
);
494 /******************************************************************************
495 * NtQuerySystemInformation [NTDLL.168]
498 * SystemInformationClass Index to a certain information structure
499 * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
500 * SystemCacheInformation SYSTEM_CACHE_INFORMATION
501 * SystemConfigurationInformation CONFIGURATION_INFORMATION
502 * observed (class/len):
507 * SystemInformation caller supplies storage for the information structure
508 * Length size of the structure
509 * ResultLength Data written
511 NTSTATUS WINAPI
NtQuerySystemInformation(
512 IN SYSTEM_INFORMATION_CLASS SystemInformationClass
,
513 OUT PVOID SystemInformation
,
515 OUT PULONG ResultLength
)
517 FIXME("(0x%08x,%p,0x%08lx,%p) stub\n",
518 SystemInformationClass
,SystemInformation
,Length
,ResultLength
);
519 ZeroMemory (SystemInformation
, Length
);
524 /******************************************************************************
525 * NtCreatePagingFile [NTDLL]
527 NTSTATUS WINAPI
NtCreatePagingFile(
528 IN PUNICODE_STRING PageFileName
,
531 OUT PULONG ActualSize
)
533 FIXME("(%p(%s),0x%08lx,0x%08lx,%p),stub!\n",
534 PageFileName
->Buffer
, debugstr_w(PageFileName
->Buffer
),MiniumSize
,MaxiumSize
,ActualSize
);
538 /******************************************************************************
539 * NtDisplayString [NTDLL.95]
541 * writes a string to the nt-textmode screen eg. during startup
543 NTSTATUS WINAPI
NtDisplayString (
544 PUNICODE_STRING string
)
546 TRACE("%p(%s)\n",string
->Buffer
, debugstr_w(string
->Buffer
));
547 WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE
), string
->Buffer
, string
->Length
, 0, 0);
551 /******************************************************************************
552 * NtPowerInformation [NTDLL]
555 NTSTATUS WINAPI
NtPowerInformation(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
,DWORD x5
)
557 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub\n",x1
,x2
,x3
,x4
,x5
);