Stubs for LsaFreeMemory, LsaQueryInformationPolicy, LsaClose.
[wine/multimedia.git] / dlls / ntdll / nt.c
blob6f278a5d51d61db2d84084682d3fb16b0b789fbd
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)
7 * Copyright 1996-1998 Marcus Meissner
8 */
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 #include <time.h>
14 #include "debugstr.h"
15 #include "debugtools.h"
17 #include "ntddk.h"
19 DEFAULT_DEBUG_CHANNEL(ntdll)
22 * Timer object
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,
37 TimerType);
38 return 0;
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,
48 IN BOOLEAN WakeTimer,
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);
54 return 0;
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);
63 return 1;
67 * Process object
70 /******************************************************************************
71 * NtTerminateProcess [NTDLL.]
73 * Native applications must kill themselves when done
74 * FIXME: return value 0-success
76 NTSTATUS WINAPI NtTerminateProcess(
77 HANDLE ProcessHandle,
78 LONG ExitStatus)
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);
102 return 0;
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);
116 return 0;
120 * Thread
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);
132 return 0;
135 /******************************************************************************
136 * NtTerminateThread [NTDLL]
138 NTSTATUS WINAPI NtTerminateThread(
139 IN HANDLE ThreadHandle,
140 IN NTSTATUS ExitStatus)
142 if ( TerminateThread(ThreadHandle,ExitStatus) )
143 return 0;
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);
162 return 0;
165 /******************************************************************************
166 * NtSetInformationThread [NTDLL]
168 NTSTATUS WINAPI NtSetInformationThread(
169 HANDLE ThreadHandle,
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);
176 return 0;
180 * Token
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);
197 return 0;
200 /******************************************************************************
201 * NtOpenProcessToken [NTDLL]
203 NTSTATUS WINAPI NtOpenProcessToken(
204 HANDLE ProcessHandle,
205 DWORD DesiredAccess,
206 HANDLE *TokenHandle)
208 FIXME("(0x%08x,0x%08lx,%p): stub\n",
209 ProcessHandle,DesiredAccess, TokenHandle);
210 *TokenHandle = 0xcafe;
211 return 0;
214 /******************************************************************************
215 * NtOpenThreadToken [NTDLL]
217 NTSTATUS WINAPI NtOpenThreadToken(
218 HANDLE ThreadHandle,
219 DWORD DesiredAccess,
220 BOOLEAN OpenAsSelf,
221 HANDLE *TokenHandle)
223 FIXME("(0x%08x,0x%08lx,0x%08x,%p): stub\n",
224 ThreadHandle,DesiredAccess, OpenAsSelf, TokenHandle);
225 *TokenHandle = 0xcafe;
226 return 0;
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);
244 return 0;
247 /******************************************************************************
248 * NtQueryInformationToken [NTDLL.156]
251 NTSTATUS WINAPI NtQueryInformationToken(
252 HANDLE token,
253 DWORD tokeninfoclass,
254 LPVOID tokeninfo,
255 DWORD tokeninfolength,
256 LPDWORD retlen )
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);
264 break;
265 case TokenUser: /* 1 */
266 *retlen = sizeof (TOKEN_USER);
267 break;
268 case TokenPrivileges:
269 *retlen = sizeof (TOKEN_PRIVILEGES);
270 break;
271 case TokenOwner:
272 *retlen = sizeof (TOKEN_OWNER);
273 break;
274 case TokenPrimaryGroup:
275 *retlen = sizeof (TOKEN_PRIMARY_GROUP);
276 break;
277 case TokenDefaultDacl:
278 *retlen = sizeof (TOKEN_DEFAULT_DACL);
279 break;
280 case TokenSource:
281 *retlen = sizeof (TOKEN_SOURCE);
282 break;
283 case TokenType:
284 *retlen = sizeof (TOKEN_TYPE);
285 break;
286 #if 0
287 case TokenImpersonationLevel:
288 case TokenStatistics:
289 #endif /* 0 */
292 return 0;
296 * Section
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);
315 return 0;
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);
329 return 0;
332 /******************************************************************************
333 * NtQuerySection [NTDLL]
335 NTSTATUS WINAPI NtQuerySection(
336 IN HANDLE SectionHandle,
337 IN PVOID SectionInformationClass,
338 OUT PVOID SectionInformation,
339 IN ULONG Length,
340 OUT PULONG ResultLength)
342 FIXME("(0x%08x,%p,%p,0x%08lx,%p) stub!\n",
343 SectionHandle,SectionInformationClass,SectionInformation,Length,ResultLength);
344 return 0;
347 /******************************************************************************
348 * NtMapViewOfSection [NTDLL]
349 * FUNCTION: Maps a view of a section into the virtual address space of a process
351 * ARGUMENTS:
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
362 * child processes
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,
369 PVOID* BaseAddress,
370 ULONG ZeroBits,
371 ULONG CommitSize,
372 PLARGE_INTEGER SectionOffset,
373 PULONG ViewSize,
374 SECTION_INHERIT InheritDisposition,
375 ULONG AllocationType,
376 ULONG Protect)
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);
381 return 0;
385 * ports
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);
394 return 0;
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);
404 return 0;
407 /******************************************************************************
408 * NtListenPort [NTDLL]
410 NTSTATUS WINAPI NtListenPort(DWORD x1,DWORD x2)
412 FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
413 return 0;
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);
422 return 0;
425 /******************************************************************************
426 * NtCompleteConnectPort [NTDLL]
428 NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1)
430 FIXME("(0x%08lx),stub!\n",x1);
431 return 0;
434 /******************************************************************************
435 * NtRegisterThreadTerminatePort [NTDLL]
437 NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1)
439 FIXME("(0x%08lx),stub!\n",x1);
440 return 0;
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);
449 return 0;
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);
458 return 0;
462 * Misc
465 /******************************************************************************
466 * NtSetIntervalProfile [NTDLL]
468 NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,DWORD x2) {
469 FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
470 return 0;
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",
481 Counter, Frequency);
482 return 0;
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);
491 return 0;
494 /******************************************************************************
495 * NtQuerySystemInformation [NTDLL.168]
497 * ARGUMENTS:
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):
503 * 0x0/0x2c
504 * 0x12/0x18
505 * 0x2/0x138
506 * 0x8/0x600
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,
514 IN ULONG Length,
515 OUT PULONG ResultLength)
517 FIXME("(0x%08x,%p,0x%08lx,%p) stub\n",
518 SystemInformationClass,SystemInformation,Length,ResultLength);
519 ZeroMemory (SystemInformation, Length);
520 return 0;
524 /******************************************************************************
525 * NtCreatePagingFile [NTDLL]
527 NTSTATUS WINAPI NtCreatePagingFile(
528 IN PUNICODE_STRING PageFileName,
529 IN ULONG MiniumSize,
530 IN ULONG MaxiumSize,
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);
535 return 0;
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);
548 return 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);
558 return 0;