1 | /* $Id: nt.cpp,v 1.4 1999-12-18 21:45:13 sandervl Exp $ */
|
---|
2 |
|
---|
3 |
|
---|
4 | /*
|
---|
5 | * NT basis DLL
|
---|
6 | *
|
---|
7 | * This file contains the Nt* API functions of NTDLL.DLL.
|
---|
8 | * In the original ntdll.dll they all seem to just call int 0x2e (down to the HAL)
|
---|
9 | *
|
---|
10 | * Copyright 1996-1998 Marcus Meissner
|
---|
11 | * Copyright 1999 Patrick Haller
|
---|
12 | */
|
---|
13 |
|
---|
14 | #include <stdlib.h>
|
---|
15 | #include <string.h>
|
---|
16 | #include <time.h>
|
---|
17 | #include <os2win.h>
|
---|
18 | #include <handlemanager.h>
|
---|
19 |
|
---|
20 | #include "ntdll.h"
|
---|
21 |
|
---|
22 |
|
---|
23 | /* move to winbase.h */
|
---|
24 |
|
---|
25 | // @@@PH can't compile this WINE code
|
---|
26 | //typedef VOID (CALLBACK *PTIMERAPCROUTINE)(LPVOID lpArgToCompletionRoutine,DWORD dwTimerLowValue,DWORD dwTimerHighValue);
|
---|
27 | typedef PVOID PTIMERAPCROUTINE;
|
---|
28 |
|
---|
29 |
|
---|
30 | /*
|
---|
31 | * Timer object
|
---|
32 | */
|
---|
33 |
|
---|
34 | /**************************************************************************
|
---|
35 | * NtCreateTimer [NTDLL.87]
|
---|
36 | */
|
---|
37 | NTSTATUS WINAPI NtCreateTimer(PHANDLE TimerHandle,
|
---|
38 | ACCESS_MASK DesiredAccess,
|
---|
39 | POBJECT_ATTRIBUTES ObjectAttributes,
|
---|
40 | TIMER_TYPE TimerType)
|
---|
41 | {
|
---|
42 | dprintf(("NTDLL: NtCreateTimer(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
43 | TimerHandle,
|
---|
44 | DesiredAccess,
|
---|
45 | ObjectAttributes,
|
---|
46 | TimerType));
|
---|
47 |
|
---|
48 | return 0;
|
---|
49 | }
|
---|
50 |
|
---|
51 |
|
---|
52 | /**************************************************************************
|
---|
53 | * NtSetTimer [NTDLL.221]
|
---|
54 | */
|
---|
55 | NTSTATUS WINAPI NtSetTimer(HANDLE TimerHandle,
|
---|
56 | PLARGE_INTEGER DueTime,
|
---|
57 | PTIMERAPCROUTINE TimerApcRoutine,
|
---|
58 | PVOID TimerContext,
|
---|
59 | BOOLEAN WakeTimer,
|
---|
60 | ULONG Period,
|
---|
61 | PBOOLEAN PreviousState)
|
---|
62 | {
|
---|
63 | dprintf(("NTDLL: NtSetTimer(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
64 | TimerHandle,
|
---|
65 | DueTime,
|
---|
66 | TimerApcRoutine,
|
---|
67 | TimerContext,
|
---|
68 | WakeTimer,
|
---|
69 | Period,
|
---|
70 | PreviousState));
|
---|
71 |
|
---|
72 | return 0;
|
---|
73 | }
|
---|
74 |
|
---|
75 |
|
---|
76 | /******************************************************************************
|
---|
77 | * NtQueryTimerResolution [NTDLL.129]
|
---|
78 | */
|
---|
79 | NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,
|
---|
80 | DWORD x2,
|
---|
81 | DWORD x3)
|
---|
82 | {
|
---|
83 | dprintf(("NTDLL: NtQueryTimerResolution(%08xh,%08xh,%08xh) not implemented.\n",
|
---|
84 | x1,
|
---|
85 | x2,
|
---|
86 | x3));
|
---|
87 |
|
---|
88 | return 1;
|
---|
89 | }
|
---|
90 |
|
---|
91 |
|
---|
92 | /*
|
---|
93 | * Process object
|
---|
94 | */
|
---|
95 |
|
---|
96 | /******************************************************************************
|
---|
97 | * NtTerminateProcess [NTDLL.]
|
---|
98 | *
|
---|
99 | * Native applications must kill themselves when done
|
---|
100 | * FIXME: return value 0-success
|
---|
101 | */
|
---|
102 | NTSTATUS WINAPI NtTerminateProcess(HANDLE ProcessHandle,
|
---|
103 | LONG ExitStatus)
|
---|
104 | {
|
---|
105 | dprintf(("NTDLL: NtTerminateProcess(%08xh,%08xh)",
|
---|
106 | ProcessHandle,
|
---|
107 | ExitStatus));
|
---|
108 |
|
---|
109 | /* win32 (0x7fffffff) to nt (-1) */
|
---|
110 | if ( NtCurrentProcess() == ProcessHandle )
|
---|
111 | ProcessHandle = GetCurrentProcess();
|
---|
112 |
|
---|
113 | /* @@@PH return code looks suspicious ! */
|
---|
114 | return (! TerminateProcess( ProcessHandle, ExitStatus ));
|
---|
115 | }
|
---|
116 |
|
---|
117 |
|
---|
118 | /******************************************************************************
|
---|
119 | * NtQueryInformationProcess [NTDLL.]
|
---|
120 | *
|
---|
121 | */
|
---|
122 | NTSTATUS WINAPI NtQueryInformationProcess(HANDLE ProcessHandle,
|
---|
123 | PROCESSINFOCLASS ProcessInformationClass,
|
---|
124 | PVOID ProcessInformation,
|
---|
125 | ULONG ProcessInformationLength,
|
---|
126 | PULONG ReturnLength)
|
---|
127 | {
|
---|
128 | dprintf(("NTDLL: NtQueryInformationProcess(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
129 | ProcessHandle,
|
---|
130 | ProcessInformationClass,
|
---|
131 | ProcessInformation,
|
---|
132 | ProcessInformationLength,
|
---|
133 | ReturnLength));
|
---|
134 |
|
---|
135 | return 0;
|
---|
136 | }
|
---|
137 |
|
---|
138 | /******************************************************************************
|
---|
139 | * NtSetInformationProcess [NTDLL.207]
|
---|
140 | */
|
---|
141 | NTSTATUS WINAPI NtSetInformationProcess(HANDLE ProcessHandle,
|
---|
142 | PROCESSINFOCLASS ProcessInformationClass,
|
---|
143 | PVOID ProcessInformation,
|
---|
144 | ULONG ProcessInformationLength)
|
---|
145 | {
|
---|
146 | dprintf(("NTDLL: NtSetInformationProcess(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
147 | ProcessHandle,
|
---|
148 | ProcessInformationClass,
|
---|
149 | ProcessInformation,
|
---|
150 | ProcessInformationLength));
|
---|
151 |
|
---|
152 | return 0;
|
---|
153 | }
|
---|
154 |
|
---|
155 |
|
---|
156 | /*
|
---|
157 | * Thread
|
---|
158 | */
|
---|
159 |
|
---|
160 | /******************************************************************************
|
---|
161 | * NtResumeThread [NTDLL]
|
---|
162 | */
|
---|
163 | NTSTATUS WINAPI NtResumeThread(HANDLE ThreadHandle,
|
---|
164 | PULONG SuspendCount)
|
---|
165 | {
|
---|
166 | dprintf(("NTDLL: NtResumeThread(%08xh,%08x) not implemented.\n",
|
---|
167 | ThreadHandle,
|
---|
168 | SuspendCount));
|
---|
169 |
|
---|
170 | return 0;
|
---|
171 | }
|
---|
172 |
|
---|
173 |
|
---|
174 | /******************************************************************************
|
---|
175 | * NtTerminateThread [NTDLL]
|
---|
176 | */
|
---|
177 | NTSTATUS WINAPI NtTerminateThread(HANDLE ThreadHandle,
|
---|
178 | NTSTATUS ExitStatus)
|
---|
179 | {
|
---|
180 | dprintf(("NTDLL: NtTerminateThread(%08xh,%08xh) not correctly implemented.\n",
|
---|
181 | ThreadHandle,
|
---|
182 | ExitStatus));
|
---|
183 |
|
---|
184 | if ( TerminateThread(ThreadHandle,ExitStatus) )
|
---|
185 | return 0;
|
---|
186 |
|
---|
187 | return 0xc0000000; /* FIXME: lasterror->ntstatus */
|
---|
188 | }
|
---|
189 |
|
---|
190 |
|
---|
191 | /******************************************************************************
|
---|
192 | * NtQueryInformationThread [NTDLL.]
|
---|
193 | *
|
---|
194 | */
|
---|
195 | NTSTATUS WINAPI NtQueryInformationThread(HANDLE ThreadHandle,
|
---|
196 | THREADINFOCLASS ThreadInformationClass,
|
---|
197 | PVOID ThreadInformation,
|
---|
198 | ULONG ThreadInformationLength,
|
---|
199 | PULONG ReturnLength)
|
---|
200 | {
|
---|
201 | dprintf(("NTDLL: NtQueryInformationThread(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
202 | ThreadHandle,
|
---|
203 | ThreadInformationClass,
|
---|
204 | ThreadInformation,
|
---|
205 | ThreadInformationLength,
|
---|
206 | ReturnLength));
|
---|
207 |
|
---|
208 | return 0;
|
---|
209 | }
|
---|
210 |
|
---|
211 |
|
---|
212 | /******************************************************************************
|
---|
213 | * NtSetInformationThread [NTDLL]
|
---|
214 | */
|
---|
215 | NTSTATUS WINAPI NtSetInformationThread(HANDLE ThreadHandle,
|
---|
216 | THREADINFOCLASS ThreadInformationClass,
|
---|
217 | PVOID ThreadInformation,
|
---|
218 | ULONG ThreadInformationLength)
|
---|
219 | {
|
---|
220 | dprintf(("NTDLL: NtSetInformationThread(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
221 | ThreadHandle,
|
---|
222 | ThreadInformationClass,
|
---|
223 | ThreadInformation,
|
---|
224 | ThreadInformationLength));
|
---|
225 |
|
---|
226 | return 0;
|
---|
227 | }
|
---|
228 |
|
---|
229 |
|
---|
230 | /*
|
---|
231 | * Token
|
---|
232 | */
|
---|
233 |
|
---|
234 | /******************************************************************************
|
---|
235 | * NtDuplicateToken [NTDLL]
|
---|
236 | */
|
---|
237 | NTSTATUS WINAPI NtDuplicateToken(HANDLE ExistingToken,
|
---|
238 | ACCESS_MASK DesiredAccess,
|
---|
239 | POBJECT_ATTRIBUTES ObjectAttributes,
|
---|
240 | SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
|
---|
241 | TOKEN_TYPE TokenType,
|
---|
242 | PHANDLE NewToken)
|
---|
243 | {
|
---|
244 | dprintf(("NTDLL: NtDuplicateToken(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
245 | ExistingToken,
|
---|
246 | DesiredAccess,
|
---|
247 | ObjectAttributes,
|
---|
248 | ImpersonationLevel,
|
---|
249 | TokenType,
|
---|
250 | NewToken));
|
---|
251 |
|
---|
252 | return 0;
|
---|
253 | }
|
---|
254 |
|
---|
255 | /******************************************************************************
|
---|
256 | * NtOpenProcessToken [NTDLL]
|
---|
257 | */
|
---|
258 | NTSTATUS WINAPI NtOpenProcessToken(HANDLE ProcessHandle,
|
---|
259 | DWORD DesiredAccess,
|
---|
260 | PHANDLE TokenHandle)
|
---|
261 | {
|
---|
262 | dprintf(("NTDLL: NtOpenProcessToken(%08xh,%08xh,%08xh) not correctly implemented.\n",
|
---|
263 | ProcessHandle,
|
---|
264 | DesiredAccess,
|
---|
265 | TokenHandle));
|
---|
266 |
|
---|
267 | if(ProcessHandle == GetCurrentProcess()) {
|
---|
268 | HMOpenProcessToken(ProcessHandle, DesiredAccess, (ULONG)&ProcSecInfo, TokenHandle);
|
---|
269 | return STATUS_SUCCESS;
|
---|
270 | }
|
---|
271 | *TokenHandle = 0;
|
---|
272 | return ERROR_INVALID_HANDLE;
|
---|
273 | }
|
---|
274 |
|
---|
275 |
|
---|
276 | /******************************************************************************
|
---|
277 | * NtOpenThreadToken [NTDLL]
|
---|
278 | */
|
---|
279 | NTSTATUS WINAPI NtOpenThreadToken(HANDLE ThreadHandle,
|
---|
280 | DWORD DesiredAccess,
|
---|
281 | BOOLEAN OpenAsSelf,
|
---|
282 | PHANDLE TokenHandle)
|
---|
283 | {
|
---|
284 | dprintf(("NTDLL: NtOpenThreadToken(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
285 | ThreadHandle,
|
---|
286 | DesiredAccess,
|
---|
287 | OpenAsSelf,
|
---|
288 | TokenHandle));
|
---|
289 |
|
---|
290 | *TokenHandle = 0;
|
---|
291 | return ERROR_INVALID_HANDLE;
|
---|
292 | }
|
---|
293 |
|
---|
294 |
|
---|
295 | /******************************************************************************
|
---|
296 | * NtAdjustPrivilegesToken [NTDLL]
|
---|
297 | *
|
---|
298 | * FIXME: parameters unsafe
|
---|
299 | */
|
---|
300 | NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE TokenHandle,
|
---|
301 | BOOLEAN DisableAllPrivileges,
|
---|
302 | PTOKEN_PRIVILEGES NewState,
|
---|
303 | DWORD BufferLength,
|
---|
304 | PTOKEN_PRIVILEGES PreviousState,
|
---|
305 | PDWORD ReturnLength)
|
---|
306 | {
|
---|
307 | dprintf(("NTDLL: NtAdjustPrivilegesToken(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
308 | TokenHandle,
|
---|
309 | DisableAllPrivileges,
|
---|
310 | NewState,
|
---|
311 | BufferLength,
|
---|
312 | PreviousState,
|
---|
313 | ReturnLength));
|
---|
314 |
|
---|
315 | return 0;
|
---|
316 | }
|
---|
317 |
|
---|
318 |
|
---|
319 | /******************************************************************************
|
---|
320 | * NtQueryInformationToken [NTDLL.156]
|
---|
321 | *
|
---|
322 | */
|
---|
323 | NTSTATUS WINAPI NtQueryInformationToken(HANDLE Token,
|
---|
324 | DWORD TokenInformationClass,
|
---|
325 | LPVOID TokenInformation,
|
---|
326 | DWORD TokenInformationLength,
|
---|
327 | LPDWORD ReturnLength)
|
---|
328 | {
|
---|
329 | PROCESSTHREAD_SECURITYINFO *pSecInfo;
|
---|
330 |
|
---|
331 | dprintf(("NTDLL: NtQueryInformationToken(%08xh,%08xh,%08xh,%08xh,%08xh) not correctly implemented.\n",
|
---|
332 | Token,
|
---|
333 | TokenInformationClass,
|
---|
334 | TokenInformation,
|
---|
335 | TokenInformationLength,
|
---|
336 | ReturnLength));
|
---|
337 |
|
---|
338 | pSecInfo = (PROCESSTHREAD_SECURITYINFO*)HMHandleGetUserData(Token);
|
---|
339 | if((ULONG)pSecInfo == -1) {
|
---|
340 | return ERROR_INVALID_HANDLE;
|
---|
341 | }
|
---|
342 | switch (TokenInformationClass)
|
---|
343 | {
|
---|
344 | case TokenGroups: /* 2 */
|
---|
345 | *ReturnLength = sizeof (TOKEN_GROUPS);
|
---|
346 | if(TokenInformationLength < sizeof (TOKEN_GROUPS)) {
|
---|
347 | return STATUS_BUFFER_TOO_SMALL;
|
---|
348 | }
|
---|
349 | memcpy(TokenInformation, (LPVOID)pSecInfo->pTokenGroups, sizeof(TOKEN_GROUPS));
|
---|
350 | break;
|
---|
351 | case TokenUser: /* 1 */
|
---|
352 | *ReturnLength = sizeof (TOKEN_USER);
|
---|
353 | if(TokenInformationLength < sizeof (TOKEN_USER)) {
|
---|
354 | return STATUS_BUFFER_TOO_SMALL;
|
---|
355 | }
|
---|
356 | memset(TokenInformation, 0, sizeof(TOKEN_USER));
|
---|
357 | break;
|
---|
358 | case TokenPrivileges:
|
---|
359 | *ReturnLength = sizeof (TOKEN_PRIVILEGES);
|
---|
360 | if(TokenInformationLength < sizeof (TOKEN_PRIVILEGES)) {
|
---|
361 | return STATUS_BUFFER_TOO_SMALL;
|
---|
362 | }
|
---|
363 | memset(TokenInformation, 0, sizeof(TOKEN_PRIVILEGES));
|
---|
364 | break;
|
---|
365 | case TokenOwner:
|
---|
366 | *ReturnLength = sizeof (TOKEN_OWNER);
|
---|
367 | if(TokenInformationLength < sizeof (TOKEN_OWNER)) {
|
---|
368 | return STATUS_BUFFER_TOO_SMALL;
|
---|
369 | }
|
---|
370 | memset(TokenInformation, 0, sizeof(TOKEN_OWNER));
|
---|
371 | break;
|
---|
372 | case TokenPrimaryGroup:
|
---|
373 | *ReturnLength = sizeof (TOKEN_PRIMARY_GROUP);
|
---|
374 | if(TokenInformationLength < sizeof (TOKEN_PRIMARY_GROUP)) {
|
---|
375 | return STATUS_BUFFER_TOO_SMALL;
|
---|
376 | }
|
---|
377 | memset(TokenInformation, 0, sizeof(TOKEN_PRIMARY_GROUP));
|
---|
378 | break;
|
---|
379 | case TokenDefaultDacl:
|
---|
380 | *ReturnLength = sizeof (TOKEN_DEFAULT_DACL);
|
---|
381 | if(TokenInformationLength < sizeof (TOKEN_DEFAULT_DACL)) {
|
---|
382 | return STATUS_BUFFER_TOO_SMALL;
|
---|
383 | }
|
---|
384 | memset(TokenInformation, 0, sizeof(TOKEN_DEFAULT_DACL));
|
---|
385 | break;
|
---|
386 | case TokenSource:
|
---|
387 | *ReturnLength = sizeof (TOKEN_SOURCE);
|
---|
388 | if(TokenInformationLength < sizeof (TOKEN_SOURCE)) {
|
---|
389 | return STATUS_BUFFER_TOO_SMALL;
|
---|
390 | }
|
---|
391 | memset(TokenInformation, 0, sizeof(TOKEN_SOURCE));
|
---|
392 | break;
|
---|
393 | case TokenType:
|
---|
394 | *ReturnLength = sizeof (TOKEN_TYPE);
|
---|
395 | if(TokenInformationLength < sizeof (TOKEN_TYPE)) {
|
---|
396 | return STATUS_BUFFER_TOO_SMALL;
|
---|
397 | }
|
---|
398 | memset(TokenInformation, 0, sizeof(TOKEN_TYPE));
|
---|
399 | break;
|
---|
400 | #if 0
|
---|
401 | case TokenImpersonationLevel:
|
---|
402 | case TokenStatistics:
|
---|
403 | #endif /* 0 */
|
---|
404 | }
|
---|
405 |
|
---|
406 | return STATUS_SUCCESS;
|
---|
407 | }
|
---|
408 |
|
---|
409 |
|
---|
410 | /*
|
---|
411 | * Section
|
---|
412 | */
|
---|
413 |
|
---|
414 | /******************************************************************************
|
---|
415 | * NtCreateSection [NTDLL]
|
---|
416 | */
|
---|
417 | NTSTATUS WINAPI NtCreateSection(PHANDLE SectionHandle,
|
---|
418 | ACCESS_MASK DesiredAccess,
|
---|
419 | POBJECT_ATTRIBUTES ObjectAttributes,
|
---|
420 | PLARGE_INTEGER MaximumSize,
|
---|
421 | ULONG SectionPageProtection,
|
---|
422 | ULONG AllocationAttributes,
|
---|
423 | HANDLE FileHandle)
|
---|
424 | {
|
---|
425 | dprintf(("NTDLL: NtCreateSection(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
426 | SectionHandle,
|
---|
427 | DesiredAccess,
|
---|
428 | ObjectAttributes,
|
---|
429 | MaximumSize,
|
---|
430 | SectionPageProtection,
|
---|
431 | AllocationAttributes,
|
---|
432 | FileHandle));
|
---|
433 |
|
---|
434 | return 0;
|
---|
435 | }
|
---|
436 |
|
---|
437 |
|
---|
438 | /******************************************************************************
|
---|
439 | * NtOpenSection [NTDLL]
|
---|
440 | */
|
---|
441 | NTSTATUS WINAPI NtOpenSection(PHANDLE SectionHandle,
|
---|
442 | ACCESS_MASK DesiredAccess,
|
---|
443 | POBJECT_ATTRIBUTES ObjectAttributes)
|
---|
444 | {
|
---|
445 | dprintf(("NTDLL: NtOpenSection(%08xh,%08xh,%08xh) not implemented.\n",
|
---|
446 | SectionHandle,
|
---|
447 | DesiredAccess,
|
---|
448 | ObjectAttributes));
|
---|
449 |
|
---|
450 | return 0;
|
---|
451 | }
|
---|
452 |
|
---|
453 |
|
---|
454 | /******************************************************************************
|
---|
455 | * NtQuerySection [NTDLL]
|
---|
456 | */
|
---|
457 | NTSTATUS WINAPI NtQuerySection(HANDLE SectionHandle,
|
---|
458 | PVOID SectionInformationClass,
|
---|
459 | PVOID SectionInformation,
|
---|
460 | ULONG Length,
|
---|
461 | PULONG ResultLength)
|
---|
462 | {
|
---|
463 | dprintf(("NTDLL: NtQuerySection(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
464 | SectionHandle,
|
---|
465 | SectionInformationClass,
|
---|
466 | SectionInformation,
|
---|
467 | Length,
|
---|
468 | ResultLength));
|
---|
469 |
|
---|
470 | return 0;
|
---|
471 | }
|
---|
472 |
|
---|
473 |
|
---|
474 | /******************************************************************************
|
---|
475 | * NtMapViewOfSection [NTDLL]
|
---|
476 | * FUNCTION: Maps a view of a section into the virtual address space of a process
|
---|
477 | *
|
---|
478 | * ARGUMENTS:
|
---|
479 | * SectionHandle Handle of the section
|
---|
480 | * ProcessHandle Handle of the process
|
---|
481 | * BaseAddress Desired base address (or NULL) on entry
|
---|
482 | * Actual base address of the view on exit
|
---|
483 | * ZeroBits Number of high order address bits that must be zero
|
---|
484 | * CommitSize Size bytes of the initially committed section of the view
|
---|
485 | * SectionOffset Offset bytes from the beginning of the section to the beginning of the view
|
---|
486 | * ViewSize Desired length of map (or zero to map all) on entry
|
---|
487 | Actual length mapped on exit
|
---|
488 | * InheritDisposition Specified how the view is to be shared with
|
---|
489 | * child processes
|
---|
490 | * AllocateType Type of allocation for the pages
|
---|
491 | * Protect Protection for the committed region of the view
|
---|
492 | */
|
---|
493 | NTSTATUS WINAPI NtMapViewOfSection(HANDLE SectionHandle,
|
---|
494 | HANDLE ProcessHandle,
|
---|
495 | PVOID* BaseAddress,
|
---|
496 | ULONG ZeroBits,
|
---|
497 | ULONG CommitSize,
|
---|
498 | PLARGE_INTEGER SectionOffset,
|
---|
499 | PULONG ViewSize,
|
---|
500 | SECTION_INHERIT InheritDisposition,
|
---|
501 | ULONG AllocationType,
|
---|
502 | ULONG Protect)
|
---|
503 | {
|
---|
504 | dprintf(("NTDLL: NtMapViewOfSection(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
505 | SectionHandle,
|
---|
506 | ProcessHandle,
|
---|
507 | BaseAddress,
|
---|
508 | ZeroBits,
|
---|
509 | CommitSize,
|
---|
510 | SectionOffset,
|
---|
511 | ViewSize,
|
---|
512 | InheritDisposition,
|
---|
513 | AllocationType,
|
---|
514 | Protect));
|
---|
515 |
|
---|
516 | return 0;
|
---|
517 | }
|
---|
518 |
|
---|
519 |
|
---|
520 | /*
|
---|
521 | * ports
|
---|
522 | */
|
---|
523 |
|
---|
524 | /******************************************************************************
|
---|
525 | * NtCreatePort [NTDLL]
|
---|
526 | */
|
---|
527 | NTSTATUS WINAPI NtCreatePort(DWORD x1,
|
---|
528 | DWORD x2,
|
---|
529 | DWORD x3,
|
---|
530 | DWORD x4,
|
---|
531 | DWORD x5)
|
---|
532 | {
|
---|
533 | dprintf(("NTDLL: NtCreatePort(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
534 | x1,
|
---|
535 | x2,
|
---|
536 | x3,
|
---|
537 | x4,
|
---|
538 | x5));
|
---|
539 |
|
---|
540 | return 0;
|
---|
541 | }
|
---|
542 |
|
---|
543 |
|
---|
544 | /******************************************************************************
|
---|
545 | * NtConnectPort [NTDLL]
|
---|
546 | */
|
---|
547 | NTSTATUS WINAPI NtConnectPort(DWORD x1,
|
---|
548 | PUNICODE_STRING uni,
|
---|
549 | DWORD x3,
|
---|
550 | DWORD x4,
|
---|
551 | DWORD x5,
|
---|
552 | DWORD x6,
|
---|
553 | DWORD x7,
|
---|
554 | DWORD x8)
|
---|
555 | {
|
---|
556 | dprintf(("NTDLL: NtConnectPort(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
557 | x1,
|
---|
558 | uni,
|
---|
559 | x3,
|
---|
560 | x4,
|
---|
561 | x5,
|
---|
562 | x6,
|
---|
563 | x7,
|
---|
564 | x8));
|
---|
565 |
|
---|
566 | return 0;
|
---|
567 | }
|
---|
568 |
|
---|
569 |
|
---|
570 | /******************************************************************************
|
---|
571 | * NtListenPort [NTDLL]
|
---|
572 | */
|
---|
573 | NTSTATUS WINAPI NtListenPort(DWORD x1,
|
---|
574 | DWORD x2)
|
---|
575 | {
|
---|
576 | dprintf(("NTDLL: NtListenPort(%08xh,%08xh) not implemented.\n",
|
---|
577 | x1,
|
---|
578 | x2));
|
---|
579 |
|
---|
580 | return 0;
|
---|
581 | }
|
---|
582 |
|
---|
583 |
|
---|
584 | /******************************************************************************
|
---|
585 | * NtAcceptConnectPort [NTDLL]
|
---|
586 | */
|
---|
587 | NTSTATUS WINAPI NtAcceptConnectPort(DWORD x1,
|
---|
588 | DWORD x2,
|
---|
589 | DWORD x3,
|
---|
590 | DWORD x4,
|
---|
591 | DWORD x5,
|
---|
592 | DWORD x6)
|
---|
593 | {
|
---|
594 | dprintf(("NTDLL: NtAcceptConnectPort(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
595 | x1,
|
---|
596 | x2,
|
---|
597 | x3,
|
---|
598 | x4,
|
---|
599 | x5,
|
---|
600 | x6));
|
---|
601 |
|
---|
602 | return 0;
|
---|
603 | }
|
---|
604 |
|
---|
605 |
|
---|
606 | /******************************************************************************
|
---|
607 | * NtCompleteConnectPort [NTDLL]
|
---|
608 | */
|
---|
609 | NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1)
|
---|
610 | {
|
---|
611 | dprintf(("NTDLL: NtCompleteConnectPort(%08xh) not implemented.\n",
|
---|
612 | x1));
|
---|
613 |
|
---|
614 | return 0;
|
---|
615 | }
|
---|
616 |
|
---|
617 |
|
---|
618 | /******************************************************************************
|
---|
619 | * NtRegisterThreadTerminatePort [NTDLL]
|
---|
620 | */
|
---|
621 | NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1)
|
---|
622 | {
|
---|
623 | dprintf(("NTDLL: NtRegisterThreadTerminatePort(%08xh) not implemented.\n",
|
---|
624 | x1));
|
---|
625 |
|
---|
626 | return 0;
|
---|
627 | }
|
---|
628 |
|
---|
629 |
|
---|
630 | /******************************************************************************
|
---|
631 | * NtRequestWaitReplyPort [NTDLL]
|
---|
632 | */
|
---|
633 | NTSTATUS WINAPI NtRequestWaitReplyPort(DWORD x1,
|
---|
634 | DWORD x2,
|
---|
635 | DWORD x3)
|
---|
636 | {
|
---|
637 | dprintf(("NTDLL: NtRequestWaitReplyPort(%08xh,%08xh,%08xh) not implemented.\n",
|
---|
638 | x1,
|
---|
639 | x2,
|
---|
640 | x3));
|
---|
641 |
|
---|
642 | return 0;
|
---|
643 | }
|
---|
644 |
|
---|
645 |
|
---|
646 | /******************************************************************************
|
---|
647 | * NtReplyWaitReceivePort [NTDLL]
|
---|
648 | */
|
---|
649 | NTSTATUS WINAPI NtReplyWaitReceivePort(DWORD x1,
|
---|
650 | DWORD x2,
|
---|
651 | DWORD x3,
|
---|
652 | DWORD x4)
|
---|
653 | {
|
---|
654 | dprintf(("NTDLL: NtReplyWaitReceivePort(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
655 | x1,
|
---|
656 | x2,
|
---|
657 | x3,
|
---|
658 | x4));
|
---|
659 |
|
---|
660 | return 0;
|
---|
661 | }
|
---|
662 |
|
---|
663 |
|
---|
664 | /*
|
---|
665 | * Misc
|
---|
666 | */
|
---|
667 |
|
---|
668 | /******************************************************************************
|
---|
669 | * NtSetIntervalProfile [NTDLL]
|
---|
670 | */
|
---|
671 | NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,
|
---|
672 | DWORD x2)
|
---|
673 | {
|
---|
674 | dprintf(("NTDLL: NtSetIntervalProfile(%08xh,%08xh) not implemented.\n",
|
---|
675 | x1,
|
---|
676 | x2));
|
---|
677 |
|
---|
678 | return 0;
|
---|
679 | }
|
---|
680 |
|
---|
681 |
|
---|
682 | /******************************************************************************
|
---|
683 | * NtQueryPerformanceCounter [NTDLL]
|
---|
684 | */
|
---|
685 | NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER Counter,
|
---|
686 | PLARGE_INTEGER Frequency)
|
---|
687 | {
|
---|
688 | dprintf(("NTDLL: NtQueryPerformanceCounter(%08xh,%08xh) not implemented.\n",
|
---|
689 | Counter,
|
---|
690 | Frequency));
|
---|
691 |
|
---|
692 | return 0;
|
---|
693 | }
|
---|
694 |
|
---|
695 |
|
---|
696 | /******************************************************************************
|
---|
697 | * NtCreateMailSlotFile [NTDLL]
|
---|
698 | */
|
---|
699 | NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,
|
---|
700 | DWORD x2,
|
---|
701 | DWORD x3,
|
---|
702 | DWORD x4,
|
---|
703 | DWORD x5,
|
---|
704 | DWORD x6,
|
---|
705 | DWORD x7,
|
---|
706 | DWORD x8)
|
---|
707 | {
|
---|
708 | dprintf(("NTDLL: NtCreateMailslotFile(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
709 | x1,
|
---|
710 | x2,
|
---|
711 | x3,
|
---|
712 | x4,
|
---|
713 | x5,
|
---|
714 | x6,
|
---|
715 | x7,
|
---|
716 | x8));
|
---|
717 |
|
---|
718 | return 0;
|
---|
719 | }
|
---|
720 |
|
---|
721 |
|
---|
722 | /******************************************************************************
|
---|
723 | * NtQuerySystemInformation [NTDLL.168]
|
---|
724 | *
|
---|
725 | * ARGUMENTS:
|
---|
726 | * SystemInformationClass Index to a certain information structure
|
---|
727 | * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
|
---|
728 | * SystemCacheInformation SYSTEM_CACHE_INFORMATION
|
---|
729 | * SystemConfigurationInformation CONFIGURATION_INFORMATION
|
---|
730 | * observed (class/len):
|
---|
731 | * 0x0/0x2c
|
---|
732 | * 0x12/0x18
|
---|
733 | * 0x2/0x138
|
---|
734 | * 0x8/0x600
|
---|
735 | * SystemInformation caller supplies storage for the information structure
|
---|
736 | * Length size of the structure
|
---|
737 | * ResultLength Data written
|
---|
738 | */
|
---|
739 | NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
---|
740 | PVOID SystemInformation,
|
---|
741 | ULONG Length,
|
---|
742 | PULONG ResultLength)
|
---|
743 | {
|
---|
744 | dprintf(("NTDLL: NtQuerySystemInformation(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
---|
745 | SystemInformationClass,
|
---|
746 | SystemInformation,
|
---|
747 | Length,
|
---|
748 | ResultLength));
|
---|
749 |
|
---|
750 | ZeroMemory (SystemInformation, Length);
|
---|
751 | return 0;
|
---|
752 | }
|
---|
753 |
|
---|
754 |
|
---|
755 | /******************************************************************************
|
---|
756 | * NtCreatePagingFile [NTDLL]
|
---|
757 | */
|
---|
758 | NTSTATUS WINAPI NtCreatePagingFile(PUNICODE_STRING PageFileName,
|
---|
759 | ULONG MinimumSize,
|
---|
760 | ULONG MaximumSize,
|
---|
761 | PULONG ActualSize)
|
---|
762 | {
|
---|
763 | dprintf(("NTDLL: NtCreatePagingFile(%08xh, %08xh, %08xh, %08xh) not implemented.\n",
|
---|
764 | PageFileName,
|
---|
765 | MinimumSize,
|
---|
766 | MaximumSize,
|
---|
767 | ActualSize));
|
---|
768 |
|
---|
769 | return 0;
|
---|
770 | }
|
---|
771 |
|
---|
772 |
|
---|
773 | /******************************************************************************
|
---|
774 | * NtDisplayString [NTDLL.95]
|
---|
775 | *
|
---|
776 | * writes a string to the nt-textmode screen eg. during startup
|
---|
777 | */
|
---|
778 | NTSTATUS WINAPI NtDisplayString (PUNICODE_STRING string)
|
---|
779 | {
|
---|
780 | dprintf(("NTDLL: NtDisplayString(%08xh\n",
|
---|
781 | string));
|
---|
782 |
|
---|
783 | WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE),
|
---|
784 | string->Buffer,
|
---|
785 | string->Length,
|
---|
786 | 0,
|
---|
787 | 0);
|
---|
788 |
|
---|
789 | return 0;
|
---|
790 | }
|
---|