blob: e9b90ef286f08d0353712789842464875cf6c929 [file] [log] [blame]
Marcus Meissner51505b11998-11-01 14:00:21 +00001/*
2 * NT basis DLL
3 *
4 * This file contains the Nt* API functions of NTDLL.DLL.
Juergen Schmied6f4435b1999-02-13 07:35:31 +00005 * In the original ntdll.dll they all seem to just call int 0x2e (down to the HAL)
Marcus Meissner51505b11998-11-01 14:00:21 +00006 *
7 * Copyright 1996-1998 Marcus Meissner
8 */
9
Patrik Stridvallfdcfdb91999-06-12 14:55:11 +000010#include <stdio.h>
Marcus Meissner51505b11998-11-01 14:00:21 +000011#include <stdlib.h>
12#include <string.h>
13#include <time.h>
Alexandre Julliard15657091999-05-23 10:25:25 +000014#include "debugtools.h"
Juergen Schmied6f4435b1999-02-13 07:35:31 +000015
Juergen Schmied026d9db1999-03-09 17:47:51 +000016#include "ntddk.h"
Juergen Schmied02d45e52000-01-23 22:35:33 +000017#include "ntdll_misc.h"
Alexandre Julliard0aa6cc22000-07-29 21:56:59 +000018#include "server.h"
Juergen Schmied026d9db1999-03-09 17:47:51 +000019
Alexandre Julliard0dd36552000-01-29 19:49:58 +000020DEFAULT_DEBUG_CHANNEL(ntdll);
Patrik Stridvallb4b9fae1999-04-19 14:56:29 +000021
Juergen Schmied026d9db1999-03-09 17:47:51 +000022/*
23 * Timer object
Marcus Meissner51505b11998-11-01 14:00:21 +000024 */
Juergen Schmied026d9db1999-03-09 17:47:51 +000025
Marcus Meissner51505b11998-11-01 14:00:21 +000026/**************************************************************************
27 * NtCreateTimer [NTDLL.87]
28 */
Juergen Schmied6f4435b1999-02-13 07:35:31 +000029NTSTATUS WINAPI NtCreateTimer(
30 OUT PHANDLE TimerHandle,
31 IN ACCESS_MASK DesiredAccess,
32 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
33 IN TIMER_TYPE TimerType)
Marcus Meissner51505b11998-11-01 14:00:21 +000034{
Juergen Schmied02d45e52000-01-23 22:35:33 +000035 FIXME("(%p,0x%08lx,%p,0x%08x) stub\n",
36 TimerHandle,DesiredAccess,ObjectAttributes, TimerType);
37 dump_ObjectAttributes(ObjectAttributes);
Marcus Meissner51505b11998-11-01 14:00:21 +000038 return 0;
39}
40/**************************************************************************
41 * NtSetTimer [NTDLL.221]
42 */
Juergen Schmied6f4435b1999-02-13 07:35:31 +000043NTSTATUS WINAPI NtSetTimer(
Alexandre Julliarda3960291999-02-26 11:11:13 +000044 IN HANDLE TimerHandle,
Juergen Schmied6f4435b1999-02-13 07:35:31 +000045 IN PLARGE_INTEGER DueTime,
46 IN PTIMERAPCROUTINE TimerApcRoutine,
47 IN PVOID TimerContext,
Juergen Schmied3426d851999-02-19 16:29:05 +000048 IN BOOLEAN WakeTimer,
Juergen Schmied6f4435b1999-02-13 07:35:31 +000049 IN ULONG Period OPTIONAL,
50 OUT PBOOLEAN PreviousState OPTIONAL)
Marcus Meissner51505b11998-11-01 14:00:21 +000051{
Alexandre Julliard15657091999-05-23 10:25:25 +000052 FIXME("(0x%08x,%p,%p,%p,%08x,0x%08lx,%p) stub\n",
Juergen Schmied6f4435b1999-02-13 07:35:31 +000053 TimerHandle,DueTime,TimerApcRoutine,TimerContext,WakeTimer,Period,PreviousState);
Marcus Meissner51505b11998-11-01 14:00:21 +000054 return 0;
55}
56
Juergen Schmied6f4435b1999-02-13 07:35:31 +000057/******************************************************************************
58 * NtQueryTimerResolution [NTDLL.129]
59 */
60NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3)
61{
Alexandre Julliard15657091999-05-23 10:25:25 +000062 FIXME("(0x%08lx,0x%08lx,0x%08lx), stub!\n",x1,x2,x3);
Marcus Meissner51505b11998-11-01 14:00:21 +000063 return 1;
64}
Juergen Schmied026d9db1999-03-09 17:47:51 +000065
66/*
67 * Process object
Marcus Meissner51505b11998-11-01 14:00:21 +000068 */
Juergen Schmied026d9db1999-03-09 17:47:51 +000069
Marcus Meissner51505b11998-11-01 14:00:21 +000070/******************************************************************************
Juergen Schmiedd1f10c51999-04-11 14:53:24 +000071 * NtTerminateProcess [NTDLL.]
72 *
73 * Native applications must kill themselves when done
Juergen Schmiedd1f10c51999-04-11 14:53:24 +000074 */
Alexandre Julliard0aa6cc22000-07-29 21:56:59 +000075NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
Juergen Schmiedd1f10c51999-04-11 14:53:24 +000076{
Alexandre Julliard0aa6cc22000-07-29 21:56:59 +000077 NTSTATUS ret;
78 struct terminate_process_request *req = get_req_buffer();
79 req->handle = handle;
80 req->exit_code = exit_code;
81 if (!(ret = server_call_noerr( REQ_TERMINATE_PROCESS )) && req->self) exit( exit_code );
82 return ret;
Juergen Schmiedd1f10c51999-04-11 14:53:24 +000083}
84
85/******************************************************************************
Marcus Meissner51505b11998-11-01 14:00:21 +000086* NtQueryInformationProcess [NTDLL.]
87*
88*/
Juergen Schmied6f4435b1999-02-13 07:35:31 +000089NTSTATUS WINAPI NtQueryInformationProcess(
Alexandre Julliarda3960291999-02-26 11:11:13 +000090 IN HANDLE ProcessHandle,
Juergen Schmied6f4435b1999-02-13 07:35:31 +000091 IN PROCESSINFOCLASS ProcessInformationClass,
92 OUT PVOID ProcessInformation,
93 IN ULONG ProcessInformationLength,
94 OUT PULONG ReturnLength)
95{
Alexandre Julliard15657091999-05-23 10:25:25 +000096 FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
Marcus Meissner12298c52000-06-25 12:51:55 +000097 ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength,ReturnLength
98 );
99 /* "These are not the debuggers you are looking for." */
100 if (ProcessInformationClass == ProcessDebugPort)
101 /* set it to 0 aka "no debugger" to satisfy copy protections */
102 memset(ProcessInformation,0,ProcessInformationLength);
103
Marcus Meissner51505b11998-11-01 14:00:21 +0000104 return 0;
105}
Juergen Schmied026d9db1999-03-09 17:47:51 +0000106
107/******************************************************************************
108 * NtSetInformationProcess [NTDLL.207]
109 */
110NTSTATUS WINAPI NtSetInformationProcess(
111 IN HANDLE ProcessHandle,
112 IN PROCESSINFOCLASS ProcessInformationClass,
113 IN PVOID ProcessInformation,
114 IN ULONG ProcessInformationLength)
115{
Alexandre Julliard15657091999-05-23 10:25:25 +0000116 FIXME("(0x%08x,0x%08x,%p,0x%08lx) stub\n",
Juergen Schmied026d9db1999-03-09 17:47:51 +0000117 ProcessHandle,ProcessInformationClass,ProcessInformation,ProcessInformationLength);
118 return 0;
119}
120
121/*
122 * Thread
123 */
124
125/******************************************************************************
126 * NtResumeThread [NTDLL]
127 */
128NTSTATUS WINAPI NtResumeThread(
129 IN HANDLE ThreadHandle,
130 IN PULONG SuspendCount)
131{
Alexandre Julliard15657091999-05-23 10:25:25 +0000132 FIXME("(0x%08x,%p),stub!\n",
Juergen Schmied026d9db1999-03-09 17:47:51 +0000133 ThreadHandle,SuspendCount);
134 return 0;
135}
136
137/******************************************************************************
138 * NtTerminateThread [NTDLL]
139 */
Alexandre Julliard0aa6cc22000-07-29 21:56:59 +0000140NTSTATUS WINAPI NtTerminateThread( IN HANDLE handle,
141 IN NTSTATUS exit_code )
Juergen Schmied026d9db1999-03-09 17:47:51 +0000142{
Alexandre Julliard0aa6cc22000-07-29 21:56:59 +0000143 NTSTATUS ret;
144 struct terminate_thread_request *req = get_req_buffer();
145 req->handle = handle;
146 req->exit_code = exit_code;
147 if (!(ret = server_call_noerr( REQ_TERMINATE_THREAD )) && req->self)
148 {
149 if (req->last) exit( exit_code );
150 else SYSDEPS_ExitThread( exit_code );
151 }
152 return ret;
Juergen Schmied026d9db1999-03-09 17:47:51 +0000153}
154
Marcus Meissner51505b11998-11-01 14:00:21 +0000155/******************************************************************************
156* NtQueryInformationThread [NTDLL.]
157*
158*/
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000159NTSTATUS WINAPI NtQueryInformationThread(
Alexandre Julliarda3960291999-02-26 11:11:13 +0000160 IN HANDLE ThreadHandle,
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000161 IN THREADINFOCLASS ThreadInformationClass,
162 OUT PVOID ThreadInformation,
163 IN ULONG ThreadInformationLength,
164 OUT PULONG ReturnLength)
165{
Alexandre Julliard15657091999-05-23 10:25:25 +0000166 FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p),stub!\n",
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000167 ThreadHandle, ThreadInformationClass, ThreadInformation,
168 ThreadInformationLength, ReturnLength);
Marcus Meissner51505b11998-11-01 14:00:21 +0000169 return 0;
170}
Juergen Schmied026d9db1999-03-09 17:47:51 +0000171
Marcus Meissner51505b11998-11-01 14:00:21 +0000172/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000173 * NtSetInformationThread [NTDLL]
174 */
175NTSTATUS WINAPI NtSetInformationThread(
176 HANDLE ThreadHandle,
177 THREADINFOCLASS ThreadInformationClass,
178 PVOID ThreadInformation,
179 ULONG ThreadInformationLength)
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000180{
Alexandre Julliard15657091999-05-23 10:25:25 +0000181 FIXME("(0x%08x,0x%08x,%p,0x%08lx),stub!\n",
Juergen Schmied026d9db1999-03-09 17:47:51 +0000182 ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength);
Marcus Meissner51505b11998-11-01 14:00:21 +0000183 return 0;
184}
185
Juergen Schmied026d9db1999-03-09 17:47:51 +0000186/*
187 * Token
Marcus Meissner51505b11998-11-01 14:00:21 +0000188 */
Marcus Meissner51505b11998-11-01 14:00:21 +0000189
190/******************************************************************************
191 * NtDuplicateToken [NTDLL]
192 */
193NTSTATUS WINAPI NtDuplicateToken(
Juergen Schmied026d9db1999-03-09 17:47:51 +0000194 IN HANDLE ExistingToken,
195 IN ACCESS_MASK DesiredAccess,
196 IN POBJECT_ATTRIBUTES ObjectAttributes,
197 IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
198 IN TOKEN_TYPE TokenType,
199 OUT PHANDLE NewToken)
200{
Alexandre Julliard15657091999-05-23 10:25:25 +0000201 FIXME("(0x%08x,0x%08lx,%p,0x%08x,0x%08x,%p),stub!\n",
Juergen Schmied02d45e52000-01-23 22:35:33 +0000202 ExistingToken, DesiredAccess, ObjectAttributes,
203 ImpersonationLevel, TokenType, NewToken);
204 dump_ObjectAttributes(ObjectAttributes);
Juergen Schmied026d9db1999-03-09 17:47:51 +0000205 return 0;
206}
207
208/******************************************************************************
209 * NtOpenProcessToken [NTDLL]
210 */
211NTSTATUS WINAPI NtOpenProcessToken(
212 HANDLE ProcessHandle,
213 DWORD DesiredAccess,
214 HANDLE *TokenHandle)
215{
Alexandre Julliard15657091999-05-23 10:25:25 +0000216 FIXME("(0x%08x,0x%08lx,%p): stub\n",
Juergen Schmied026d9db1999-03-09 17:47:51 +0000217 ProcessHandle,DesiredAccess, TokenHandle);
218 *TokenHandle = 0xcafe;
219 return 0;
220}
221
222/******************************************************************************
223 * NtOpenThreadToken [NTDLL]
224 */
225NTSTATUS WINAPI NtOpenThreadToken(
226 HANDLE ThreadHandle,
227 DWORD DesiredAccess,
228 BOOLEAN OpenAsSelf,
229 HANDLE *TokenHandle)
230{
Alexandre Julliard15657091999-05-23 10:25:25 +0000231 FIXME("(0x%08x,0x%08lx,0x%08x,%p): stub\n",
Juergen Schmied026d9db1999-03-09 17:47:51 +0000232 ThreadHandle,DesiredAccess, OpenAsSelf, TokenHandle);
233 *TokenHandle = 0xcafe;
Marcus Meissner51505b11998-11-01 14:00:21 +0000234 return 0;
235}
236
237/******************************************************************************
238 * NtAdjustPrivilegesToken [NTDLL]
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000239 *
240 * FIXME: parameters unsafe
Marcus Meissner51505b11998-11-01 14:00:21 +0000241 */
242NTSTATUS WINAPI NtAdjustPrivilegesToken(
Alexandre Julliarda3960291999-02-26 11:11:13 +0000243 IN HANDLE TokenHandle,
Juergen Schmied3426d851999-02-19 16:29:05 +0000244 IN BOOLEAN DisableAllPrivileges,
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000245 IN PTOKEN_PRIVILEGES NewState,
246 IN DWORD BufferLength,
247 OUT PTOKEN_PRIVILEGES PreviousState,
248 OUT PDWORD ReturnLength)
249{
Alexandre Julliard15657091999-05-23 10:25:25 +0000250 FIXME("(0x%08x,0x%08x,%p,0x%08lx,%p,%p),stub!\n",
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000251 TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength);
Marcus Meissner51505b11998-11-01 14:00:21 +0000252 return 0;
253}
254
255/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000256* NtQueryInformationToken [NTDLL.156]
257*
Juergen Schmied02d45e52000-01-23 22:35:33 +0000258* NOTES
259* Buffer for TokenUser:
260* 0x00 TOKEN_USER the PSID field points to the SID
261* 0x08 SID
262*
Juergen Schmied026d9db1999-03-09 17:47:51 +0000263*/
264NTSTATUS WINAPI NtQueryInformationToken(
265 HANDLE token,
266 DWORD tokeninfoclass,
267 LPVOID tokeninfo,
268 DWORD tokeninfolength,
269 LPDWORD retlen )
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000270{
Alexandre Julliard15657091999-05-23 10:25:25 +0000271 FIXME("(%08x,%ld,%p,%ld,%p): stub\n",
Juergen Schmied026d9db1999-03-09 17:47:51 +0000272 token,tokeninfoclass,tokeninfo,tokeninfolength,retlen);
273
274 switch (tokeninfoclass)
275 { case TokenGroups: /* 2 */
Patrik Stridvalla9a671d1999-04-25 19:01:52 +0000276 *retlen = sizeof (TOKEN_GROUPS);
Juergen Schmied044db461999-12-11 23:19:54 +0000277 break;
Juergen Schmied026d9db1999-03-09 17:47:51 +0000278 case TokenUser: /* 1 */
Juergen Schmied02d45e52000-01-23 22:35:33 +0000279 {
280 int len = sizeof (TOKEN_USER)+ sizeof(SID);
281 *retlen = len;
282 if ( len <= tokeninfolength)
283 if( tokeninfo )
284 {
285 TOKEN_USER * tuser = tokeninfo;
286 PSID sid = (PSID) &((LPBYTE)tokeninfo)[sizeof(TOKEN_USER)];
287 SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
288 RtlInitializeSid(sid, &localSidAuthority, 1);
289 *(RtlSubAuthoritySid(sid, 0)) = SECURITY_INTERACTIVE_RID;
290 tuser->User.Sid = sid;
291 }
292 }
Juergen Schmied044db461999-12-11 23:19:54 +0000293 break;
Juergen Schmied026d9db1999-03-09 17:47:51 +0000294 case TokenPrivileges:
Juergen Schmied044db461999-12-11 23:19:54 +0000295 *retlen = sizeof (TOKEN_PRIVILEGES);
296 break;
Juergen Schmied026d9db1999-03-09 17:47:51 +0000297 case TokenOwner:
Juergen Schmied044db461999-12-11 23:19:54 +0000298 *retlen = sizeof (TOKEN_OWNER);
299 break;
Juergen Schmied026d9db1999-03-09 17:47:51 +0000300 case TokenPrimaryGroup:
Juergen Schmied044db461999-12-11 23:19:54 +0000301 *retlen = sizeof (TOKEN_PRIMARY_GROUP);
302 break;
Juergen Schmied026d9db1999-03-09 17:47:51 +0000303 case TokenDefaultDacl:
Juergen Schmied044db461999-12-11 23:19:54 +0000304 *retlen = sizeof (TOKEN_DEFAULT_DACL);
305 break;
Juergen Schmied026d9db1999-03-09 17:47:51 +0000306 case TokenSource:
Juergen Schmied044db461999-12-11 23:19:54 +0000307 *retlen = sizeof (TOKEN_SOURCE);
308 break;
Juergen Schmied026d9db1999-03-09 17:47:51 +0000309 case TokenType:
Juergen Schmied044db461999-12-11 23:19:54 +0000310 *retlen = sizeof (TOKEN_TYPE);
311 break;
312#if 0
Juergen Schmied026d9db1999-03-09 17:47:51 +0000313 case TokenImpersonationLevel:
314 case TokenStatistics:
Patrik Stridvalla9a671d1999-04-25 19:01:52 +0000315#endif /* 0 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000316 }
317
Marcus Meissner51505b11998-11-01 14:00:21 +0000318 return 0;
319}
320
Juergen Schmied026d9db1999-03-09 17:47:51 +0000321/*
322 * Section
Marcus Meissner51505b11998-11-01 14:00:21 +0000323 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000324
Marcus Meissner51505b11998-11-01 14:00:21 +0000325/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000326 * NtCreateSection [NTDLL]
Marcus Meissner51505b11998-11-01 14:00:21 +0000327 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000328NTSTATUS WINAPI NtCreateSection(
329 OUT PHANDLE SectionHandle,
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000330 IN ACCESS_MASK DesiredAccess,
Juergen Schmied026d9db1999-03-09 17:47:51 +0000331 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
332 IN PLARGE_INTEGER MaximumSize OPTIONAL,
333 IN ULONG SectionPageProtection OPTIONAL,
334 IN ULONG AllocationAttributes,
335 IN HANDLE FileHandle OPTIONAL)
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000336{
Juergen Schmied02d45e52000-01-23 22:35:33 +0000337 FIXME("(%p,0x%08lx,%p,%p,0x%08lx,0x%08lx,0x%08x) stub\n",
338 SectionHandle,DesiredAccess, ObjectAttributes,
Juergen Schmied026d9db1999-03-09 17:47:51 +0000339 MaximumSize,SectionPageProtection,AllocationAttributes,FileHandle);
Juergen Schmied02d45e52000-01-23 22:35:33 +0000340 dump_ObjectAttributes(ObjectAttributes);
Marcus Meissner51505b11998-11-01 14:00:21 +0000341 return 0;
342}
343
344/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000345 * NtOpenSection [NTDLL]
Marcus Meissner51505b11998-11-01 14:00:21 +0000346 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000347NTSTATUS WINAPI NtOpenSection(
348 PHANDLE SectionHandle,
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000349 ACCESS_MASK DesiredAccess,
Juergen Schmied026d9db1999-03-09 17:47:51 +0000350 POBJECT_ATTRIBUTES ObjectAttributes)
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000351{
Juergen Schmied02d45e52000-01-23 22:35:33 +0000352 FIXME("(%p,0x%08lx,%p),stub!\n",
353 SectionHandle,DesiredAccess,ObjectAttributes);
354 dump_ObjectAttributes(ObjectAttributes);
Marcus Meissner51505b11998-11-01 14:00:21 +0000355 return 0;
356}
357
358/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000359 * NtQuerySection [NTDLL]
360 */
361NTSTATUS WINAPI NtQuerySection(
362 IN HANDLE SectionHandle,
363 IN PVOID SectionInformationClass,
364 OUT PVOID SectionInformation,
365 IN ULONG Length,
366 OUT PULONG ResultLength)
367{
Alexandre Julliard15657091999-05-23 10:25:25 +0000368 FIXME("(0x%08x,%p,%p,0x%08lx,%p) stub!\n",
Juergen Schmied026d9db1999-03-09 17:47:51 +0000369 SectionHandle,SectionInformationClass,SectionInformation,Length,ResultLength);
370 return 0;
371}
372
373/******************************************************************************
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000374 * NtMapViewOfSection [NTDLL]
375 * FUNCTION: Maps a view of a section into the virtual address space of a process
376 *
377 * ARGUMENTS:
378 * SectionHandle Handle of the section
379 * ProcessHandle Handle of the process
380 * BaseAddress Desired base address (or NULL) on entry
381 * Actual base address of the view on exit
382 * ZeroBits Number of high order address bits that must be zero
383 * CommitSize Size in bytes of the initially committed section of the view
384 * SectionOffset Offset in bytes from the beginning of the section to the beginning of the view
385 * ViewSize Desired length of map (or zero to map all) on entry
386 Actual length mapped on exit
387 * InheritDisposition Specified how the view is to be shared with
388 * child processes
389 * AllocateType Type of allocation for the pages
390 * Protect Protection for the committed region of the view
Marcus Meissner51505b11998-11-01 14:00:21 +0000391 */
392NTSTATUS WINAPI NtMapViewOfSection(
Alexandre Julliarda3960291999-02-26 11:11:13 +0000393 HANDLE SectionHandle,
394 HANDLE ProcessHandle,
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000395 PVOID* BaseAddress,
396 ULONG ZeroBits,
397 ULONG CommitSize,
398 PLARGE_INTEGER SectionOffset,
399 PULONG ViewSize,
400 SECTION_INHERIT InheritDisposition,
401 ULONG AllocationType,
402 ULONG Protect)
403{
Alexandre Julliard15657091999-05-23 10:25:25 +0000404 FIXME("(0x%08x,0x%08x,%p,0x%08lx,0x%08lx,%p,%p,0x%08x,0x%08lx,0x%08lx) stub\n",
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000405 SectionHandle,ProcessHandle,BaseAddress,ZeroBits,CommitSize,SectionOffset,
406 ViewSize,InheritDisposition,AllocationType,Protect);
Marcus Meissner51505b11998-11-01 14:00:21 +0000407 return 0;
408}
409
Juergen Schmied026d9db1999-03-09 17:47:51 +0000410/*
411 * ports
Marcus Meissner51505b11998-11-01 14:00:21 +0000412 */
Marcus Meissner51505b11998-11-01 14:00:21 +0000413
414/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000415 * NtCreatePort [NTDLL]
Marcus Meissner51505b11998-11-01 14:00:21 +0000416 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000417NTSTATUS WINAPI NtCreatePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5)
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000418{
Alexandre Julliard15657091999-05-23 10:25:25 +0000419 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5);
Marcus Meissner51505b11998-11-01 14:00:21 +0000420 return 0;
421}
422
Marcus Meissner51505b11998-11-01 14:00:21 +0000423/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000424 * NtConnectPort [NTDLL]
Marcus Meissner51505b11998-11-01 14:00:21 +0000425 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000426NTSTATUS WINAPI NtConnectPort(DWORD x1,PUNICODE_STRING uni,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8)
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000427{
Alexandre Julliard15657091999-05-23 10:25:25 +0000428 FIXME("(0x%08lx,%s,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",
Juergen Schmied026d9db1999-03-09 17:47:51 +0000429 x1,debugstr_w(uni->Buffer),x3,x4,x5,x6,x7,x8);
Marcus Meissner51505b11998-11-01 14:00:21 +0000430 return 0;
431}
432
433/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000434 * NtListenPort [NTDLL]
Marcus Meissner51505b11998-11-01 14:00:21 +0000435 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000436NTSTATUS WINAPI NtListenPort(DWORD x1,DWORD x2)
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000437{
Alexandre Julliard15657091999-05-23 10:25:25 +0000438 FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
Marcus Meissner51505b11998-11-01 14:00:21 +0000439 return 0;
440}
441
442/******************************************************************************
443 * NtAcceptConnectPort [NTDLL]
444 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000445NTSTATUS WINAPI NtAcceptConnectPort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6)
446{
Alexandre Julliard15657091999-05-23 10:25:25 +0000447 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6);
Marcus Meissner51505b11998-11-01 14:00:21 +0000448 return 0;
449}
450
451/******************************************************************************
452 * NtCompleteConnectPort [NTDLL]
453 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000454NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1)
455{
Alexandre Julliard15657091999-05-23 10:25:25 +0000456 FIXME("(0x%08lx),stub!\n",x1);
Marcus Meissner51505b11998-11-01 14:00:21 +0000457 return 0;
458}
459
460/******************************************************************************
461 * NtRegisterThreadTerminatePort [NTDLL]
462 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000463NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1)
464{
Alexandre Julliard15657091999-05-23 10:25:25 +0000465 FIXME("(0x%08lx),stub!\n",x1);
Marcus Meissner51505b11998-11-01 14:00:21 +0000466 return 0;
467}
468
469/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000470 * NtRequestWaitReplyPort [NTDLL]
Marcus Meissner51505b11998-11-01 14:00:21 +0000471 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000472NTSTATUS WINAPI NtRequestWaitReplyPort(DWORD x1,DWORD x2,DWORD x3)
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000473{
Alexandre Julliard15657091999-05-23 10:25:25 +0000474 FIXME("(0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3);
Juergen Schmied026d9db1999-03-09 17:47:51 +0000475 return 0;
Marcus Meissner51505b11998-11-01 14:00:21 +0000476}
477
478/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000479 * NtReplyWaitReceivePort [NTDLL]
480 */
481NTSTATUS WINAPI NtReplyWaitReceivePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4)
482{
Alexandre Julliard15657091999-05-23 10:25:25 +0000483 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4);
Juergen Schmied026d9db1999-03-09 17:47:51 +0000484 return 0;
485}
486
487/*
488 * Misc
489 */
490
491 /******************************************************************************
Marcus Meissner51505b11998-11-01 14:00:21 +0000492 * NtSetIntervalProfile [NTDLL]
493 */
494NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,DWORD x2) {
Alexandre Julliard15657091999-05-23 10:25:25 +0000495 FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
Marcus Meissner51505b11998-11-01 14:00:21 +0000496 return 0;
497}
498
499/******************************************************************************
Juergen Schmied276ef661998-12-24 14:34:55 +0000500 * NtQueryPerformanceCounter [NTDLL]
501 */
Juergen Schmied3426d851999-02-19 16:29:05 +0000502NTSTATUS WINAPI NtQueryPerformanceCounter(
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000503 IN PLARGE_INTEGER Counter,
504 IN PLARGE_INTEGER Frequency)
505{
Alexandre Julliard15657091999-05-23 10:25:25 +0000506 FIXME("(%p, 0%p) stub\n",
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000507 Counter, Frequency);
Juergen Schmied276ef661998-12-24 14:34:55 +0000508 return 0;
509}
Juergen Schmied026d9db1999-03-09 17:47:51 +0000510
Juergen Schmied276ef661998-12-24 14:34:55 +0000511/******************************************************************************
Patrik Stridvallfcfacb92000-03-24 20:46:04 +0000512 * NtCreateMailslotFile [NTDLL]
Juergen Schmied276ef661998-12-24 14:34:55 +0000513 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000514NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8)
515{
Alexandre Julliard15657091999-05-23 10:25:25 +0000516 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);
Juergen Schmied026d9db1999-03-09 17:47:51 +0000517 return 0;
518}
519
520/******************************************************************************
521 * NtQuerySystemInformation [NTDLL.168]
522 *
523 * ARGUMENTS:
524 * SystemInformationClass Index to a certain information structure
525 * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
526 * SystemCacheInformation SYSTEM_CACHE_INFORMATION
527 * SystemConfigurationInformation CONFIGURATION_INFORMATION
528 * observed (class/len):
529 * 0x0/0x2c
530 * 0x12/0x18
531 * 0x2/0x138
532 * 0x8/0x600
533 * SystemInformation caller supplies storage for the information structure
534 * Length size of the structure
535 * ResultLength Data written
536 */
537NTSTATUS WINAPI NtQuerySystemInformation(
538 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
539 OUT PVOID SystemInformation,
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000540 IN ULONG Length,
541 OUT PULONG ResultLength)
542{
Alexandre Julliard15657091999-05-23 10:25:25 +0000543 FIXME("(0x%08x,%p,0x%08lx,%p) stub\n",
Juergen Schmied026d9db1999-03-09 17:47:51 +0000544 SystemInformationClass,SystemInformation,Length,ResultLength);
545 ZeroMemory (SystemInformation, Length);
Juergen Schmied276ef661998-12-24 14:34:55 +0000546 return 0;
547}
548
Juergen Schmied026d9db1999-03-09 17:47:51 +0000549
Juergen Schmied276ef661998-12-24 14:34:55 +0000550/******************************************************************************
Juergen Schmied026d9db1999-03-09 17:47:51 +0000551 * NtCreatePagingFile [NTDLL]
Juergen Schmied276ef661998-12-24 14:34:55 +0000552 */
Juergen Schmied026d9db1999-03-09 17:47:51 +0000553NTSTATUS WINAPI NtCreatePagingFile(
554 IN PUNICODE_STRING PageFileName,
555 IN ULONG MiniumSize,
556 IN ULONG MaxiumSize,
557 OUT PULONG ActualSize)
Juergen Schmied6f4435b1999-02-13 07:35:31 +0000558{
Alexandre Julliard15657091999-05-23 10:25:25 +0000559 FIXME("(%p(%s),0x%08lx,0x%08lx,%p),stub!\n",
Juergen Schmiedd1f10c51999-04-11 14:53:24 +0000560 PageFileName->Buffer, debugstr_w(PageFileName->Buffer),MiniumSize,MaxiumSize,ActualSize);
Juergen Schmied276ef661998-12-24 14:34:55 +0000561 return 0;
562}
563
Juergen Schmiedd1f10c51999-04-11 14:53:24 +0000564/******************************************************************************
565 * NtDisplayString [NTDLL.95]
566 *
567 * writes a string to the nt-textmode screen eg. during startup
568 */
569NTSTATUS WINAPI NtDisplayString (
570 PUNICODE_STRING string)
571{
Alexandre Julliard15657091999-05-23 10:25:25 +0000572 TRACE("%p(%s)\n",string->Buffer, debugstr_w(string->Buffer));
Juergen Schmiedd1f10c51999-04-11 14:53:24 +0000573 WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), string->Buffer, string->Length, 0, 0);
574 return 0;
575}
Marcus Meissnereff40871999-12-10 03:27:15 +0000576
577/******************************************************************************
Juergen Schmied02d45e52000-01-23 22:35:33 +0000578 * _alldiv [NTDLL.937]
579 *
580 *
581 */
582long long WINAPI _alldiv(LARGE_INTEGER a, LARGE_INTEGER b)
583{
584#if SIZEOF_LONG_LONG==8
585 return (*(long long*)&a / *(long long*)&b);
586#else
Dan Scott4d8d8b52000-03-04 19:22:13 +0000587 FIXME("stub\n");
588 return 0;
Juergen Schmied02d45e52000-01-23 22:35:33 +0000589#endif
590}
591/******************************************************************************
592 * _allmul [NTDLL.938]
593 *
594 *
595 */
596long long WINAPI _allmul(LARGE_INTEGER a, LARGE_INTEGER b)
597{
598#if SIZEOF_LONG_LONG==8
599 return (*(long long*)&a * *(long long*)&b);
600#else
Dan Scott4d8d8b52000-03-04 19:22:13 +0000601 FIXME("stub\n");
602 return 0;
Juergen Schmied02d45e52000-01-23 22:35:33 +0000603#endif
604}
605
606/******************************************************************************
Marcus Meissnereff40871999-12-10 03:27:15 +0000607 * NtPowerInformation [NTDLL]
608 *
609 */
610NTSTATUS WINAPI NtPowerInformation(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5)
611{
612 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub\n",x1,x2,x3,x4,x5);
613 return 0;
614}
Juergen Schmied02d45e52000-01-23 22:35:33 +0000615
616/******************************************************************************
617 * NtAllocateLocallyUniqueId
618 *
619 * FIXME: the server should do that
620 */
621NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID Luid)
622{
623 static LUID luid;
624
625 FIXME("%p (0x%08lx%08lx)\n", Luid, luid.DUMMYSTRUCTNAME.HighPart, luid.DUMMYSTRUCTNAME.LowPart);
626
627 luid.QuadPart++;
628
629 Luid->QuadPart = luid.QuadPart;
630 return STATUS_SUCCESS;
631}