Added more time functions
[reactos.git] / reactos / include / ddk / zwtypes.h
1 #ifndef __INCLUDE_DDK_ZWTYPES_H
2 #define __INCLUDE_DDK_ZWTYPES_H
3
4 #define NtCurrentProcess() ( (HANDLE) 0xFFFFFFFF )
5 #define NtCurrentThread() ( (HANDLE) 0xFFFFFFFE )
6
7
8
9 // event access mask
10
11 #define EVENT_READ_ACCESS 1
12 #define EVENT_WRITE_ACCESS 2
13
14
15 // file disposition values
16
17
18 #define FILE_SUPERSEDE 0x0000
19 #define FILE_OPEN 0x0001
20 #define FILE_CREATE 0x0002
21 #define FILE_OPEN_IF 0x0003
22 #define FILE_OVERWRITE 0x0004
23 #define FILE_OVERWRITE_IF 0x0005
24 #define FILE_MAXIMUM_DISPOSITION 0x0005
25
26 //process query / set information class
27
28 #define ProcessBasicInformation 0
29 #define ProcessQuotaLimits 1
30 #define ProcessIoCounters 2
31 #define ProcessVmCounters 3
32 #define ProcessTimes 4
33 #define ProcessBasePriority 5
34 #define ProcessRaisePriority 6
35 #define ProcessDebugPort 7
36 #define ProcessExceptionPort 8
37 #define ProcessAccessToken 9
38 #define ProcessLdtInformation 10
39 #define ProcessLdtSize 11
40 #define ProcessDefaultHardErrorMode 12
41 #define ProcessIoPortHandlers 13
42 #define ProcessPooledUsageAndLimits 14
43 #define ProcessWorkingSetWatch 15
44 #define ProcessUserModeIOPL 16
45 #define ProcessEnableAlignmentFaultFixup 17
46 #define ProcessPriorityClass 18
47 #define ProcessWx86Information 19
48 #define ProcessHandleCount 20
49 #define ProcessAffinityMask 21
50 #define ProcessImageFileName 22
51 #define MaxProcessInfoClass 23
52
53 // thread query / set information class
54 #define ThreadBasicInformation 0
55 #define ThreadTimes 1
56 #define ThreadPriority 2
57 #define ThreadBasePriority 3
58 #define ThreadAffinityMask 4
59 #define ThreadImpersonationToken 5
60 #define ThreadDescriptorTableEntry 6
61 #define ThreadEnableAlignmentFaultFixup 7
62 #define ThreadEventPair 8
63 #define ThreadQuerySetWin32StartAddress 9
64 #define ThreadZeroTlsCell 10
65 #define ThreadPerformanceCount 11
66 #define ThreadAmILastThread 12
67 #define ThreadIdealProcessor 13
68 #define ThreadPriorityBoost 14
69 #define MaxThreadInfoClass 15
70
71 // object handle information
72
73 #define ObjectBasicInformation 0
74 #define ObjectNameInformation 1
75 #define ObjectTypeInformation 2
76 #define ObjectAllInformation 3
77 #define ObjectDataInformation 4
78
79 // semaphore information
80
81 #define SemaphoreBasicInformation 0
82
83 // event information
84
85 #define EventBasicInformation 0
86
87 // system information
88
89 #define SystemInformation0 0
90 #define SystemInformation1 1
91 #define SystemPerformanceInformation 2
92 #define SystemTimeInformation 3
93 #define SystemProcessInformation 5
94 #define SystemGlobalFlagInformation 9
95 #define SystemDriverInformation 11
96 #define SystemPageFileInformation 18
97 #define SystemCacheInformation 21
98 #define SystemPoolTagStatsInformation 22
99 #define SystemTimeAdjustmentInformation 28
100 #define SystemTimeZoneInformation 44
101
102 // memory information
103
104 #define MemoryBasicInformation 0
105
106 // shutdown action
107
108 typedef enum SHUTDOWN_ACTION_TAG {
109 ShutdownNoReboot,
110 ShutdownReboot,
111 ShutdownPowerOff
112 } SHUTDOWN_ACTION;
113
114 // wait type
115
116 #define WaitAll 0
117 #define WaitAny 1
118
119 // number of wait objects
120
121 #define THREAD_WAIT_OBJECTS 3
122 //#define MAXIMUM_WAIT_OBJECTS 64
123
124 // key restore flags
125
126 #define REG_WHOLE_HIVE_VOLATILE 1
127 #define REG_REFRESH_HIVE 2
128
129 // object type access rights
130
131 #define OBJECT_TYPE_CREATE 0x0001
132 #define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
133
134 // directory access rights
135
136 #define DIRECTORY_QUERY 0x0001
137 #define DIRECTORY_TRAVERSE 0x0002
138 #define DIRECTORY_CREATE_OBJECT 0x0004
139 #define DIRECTORY_CREATE_SUBDIRECTORY 0x0008
140
141 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
142
143 // symbolic link access rights
144
145 #define SYMBOLIC_LINK_QUERY 0x0001
146 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
147
148 typedef struct _PROCESS_WS_WATCH_INFORMATION
149 {
150 PVOID FaultingPc;
151 PVOID FaultingVa;
152 } PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION;
153
154 typedef struct _PROCESS_BASIC_INFORMATION
155 {
156 NTSTATUS ExitStatus;
157 PPEB PebBaseAddress;
158 KAFFINITY AffinityMask;
159 KPRIORITY BasePriority;
160 ULONG UniqueProcessId;
161 ULONG InheritedFromUniqueProcessId;
162 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
163
164 typedef struct _QUOTA_LIMITS
165 {
166 ULONG PagedPoolLimit;
167 ULONG NonPagedPoolLimit;
168 ULONG MinimumWorkingSetSize;
169 ULONG MaximumWorkingSetSize;
170 ULONG PagefileLimit;
171 TIME TimeLimit;
172 } QUOTA_LIMITS, *PQUOTA_LIMITS;
173
174 typedef struct _IO_COUNTERS
175 {
176 ULONG ReadOperationCount;
177 ULONG WriteOperationCount;
178 ULONG OtherOperationCount;
179 LARGE_INTEGER ReadTransferCount;
180 LARGE_INTEGER WriteTransferCount;
181 LARGE_INTEGER OtherTransferCount;
182 } IO_COUNTERS, *PIO_COUNTERS;
183
184
185 typedef struct _VM_COUNTERS_
186 {
187 ULONG PeakVirtualSize;
188 ULONG VirtualSize;
189 ULONG PageFaultCount;
190 ULONG PeakWorkingSetSize;
191 ULONG WorkingSetSize;
192 ULONG QuotaPeakPagedPoolUsage;
193 ULONG QuotaPagedPoolUsage;
194 ULONG QuotaPeakNonPagedPoolUsage;
195 ULONG QuotaNonPagedPoolUsage;
196 ULONG PagefileUsage;
197 ULONG PeakPagefileUsage;
198 } VM_COUNTERS, *PVM_COUNTERS;
199
200
201 typedef struct _POOLED_USAGE_AND_LIMITS_
202 {
203 ULONG PeakPagedPoolUsage;
204 ULONG PagedPoolUsage;
205 ULONG PagedPoolLimit;
206 ULONG PeakNonPagedPoolUsage;
207 ULONG NonPagedPoolUsage;
208 ULONG NonPagedPoolLimit;
209 ULONG PeakPagefileUsage;
210 ULONG PagefileUsage;
211 ULONG PagefileLimit;
212 } POOLED_USAGE_AND_LIMITS, *PPOOLED_USAGE_AND_LIMITS;
213
214
215 typedef struct _PROCESS_ACCESS_TOKEN
216 {
217 HANDLE Token;
218 HANDLE Thread;
219 } PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN;
220
221 typedef struct _KERNEL_USER_TIMES
222 {
223 TIME CreateTime;
224 TIME ExitTime;
225 TIME KernelTime;
226 TIME UserTime;
227 } KERNEL_USER_TIMES;
228 typedef KERNEL_USER_TIMES *PKERNEL_USER_TIMES;
229
230 // thread information
231
232 // incompatible with MS NT
233
234 typedef struct _THREAD_BASIC_INFORMATION
235 {
236 NTSTATUS ExitStatus;
237 PVOID TebBaseAddress;
238 KAFFINITY AffinityMask;
239 KPRIORITY BasePriority;
240 ULONG UniqueThreadId;
241 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
242
243 // object information
244
245 typedef struct _OBJECT_NAME_INFORMATION
246 {
247 UNICODE_STRING Name;
248 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
249
250
251
252 typedef struct _OBJECT_DATA_INFORMATION
253 {
254 BOOLEAN bInheritHandle;
255 BOOLEAN bProtectFromClose;
256 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
257
258
259 typedef struct _OBJECT_TYPE_INFORMATION
260 {
261 UNICODE_STRING Name;
262 UNICODE_STRING Type;
263 ULONG TotalHandles;
264 ULONG ReferenceCount;
265 } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
266
267 // system information
268
269 #if 0
270 #pragma pack(2)
271 typedef struct _SYSTEM_THREAD_INFORMATION
272 {
273 FILETIME ftCreationTime;
274 DWORD dwUnknown1;
275 PVOID dwStartAddress;
276 DWORD dwOwningPID;
277 DWORD dwThreadID;
278 DWORD dwCurrentPriority;
279 DWORD dwBasePriority;
280 DWORD dwContextSwitches;
281 DWORD dwThreadState;
282 DWORD dwWaitReason;
283 DWORD dwUnknown2 [ 5 ];
284
285
286 } SYSTEM_THREAD_INFORMATION, * PSYSTEM_THREAD_INFORMATION;
287
288
289 typedef struct _SYSTEM_PROCESS_INFORMATION
290 {
291 DWORD dwOffset;
292 DWORD dwThreadCount;
293 DWORD dwUnknown1 [6];
294 FILETIME ftCreationTime;
295 DWORD dwUnknown2 [5];
296 WCHAR * pszProcessName;
297 DWORD dwBasePriority;
298 DWORD dwProcessID;
299 DWORD dwParentProcessID;
300 DWORD dwHandleCount;
301 DWORD dwUnknown3;
302 DWORD dwUnknown4;
303 DWORD dwVirtualBytesPeak;
304 DWORD dwVirtualBytes;
305 DWORD dwPageFaults;
306 DWORD dwWorkingSetPeak;
307 DWORD dwWorkingSet;
308 DWORD dwUnknown5;
309 DWORD dwPagedPool;
310 DWORD dwUnknown6;
311 DWORD dwNonPagedPool;
312 DWORD dwPageFileBytesPeak;
313 DWORD dwPrivateBytes;
314 DWORD dwPageFileBytes;
315 DWORD dwUnknown7 [4];
316 SYSTEM_THREAD_INFORMATION Threads [1];
317
318 } SYSTEM_PROCESS_INFORMATION, * PSYSTEM_PROCESS_INFORMATION;
319 #endif
320
321 typedef struct _SYSTEM_TIME_INFORMATION
322 {
323 LARGE_INTEGER BootTime;
324 LARGE_INTEGER SystemTime;
325 LARGE_INTEGER TimeZoneBias;
326 ULONG TimeZoneId;
327 ULONG Unknown;
328 } SYSTEM_TIME_INFORMATION, *PSYSTEM_TIME_INFORMATION;
329
330 typedef struct _SYSTEM_GLOBAL_FLAGS_INFO
331 {
332 DWORD GlobalFlags;
333
334 } SYSTEM_GLOBAL_FLAGS_INFO, * PSYSTEM_GLOBAL_FLAGS_INFO;
335
336 #if 0
337 #pragma pack(4)
338 typedef struct _SYSTEM_DRIVER_INFO
339 {
340 PVOID BaseAddress;
341 DWORD Unknown1;
342 DWORD Unknown2;
343 DWORD EntryIndex;
344 DWORD Unknown4;
345 CHAR DriverName [256];
346
347 } SYSTEM_DRIVER_INFO, * PSYSTEM_DRIVER_INFO;
348
349
350 typedef struct _SYSTEM_DRIVERS_INFO
351 {
352 DWORD DriverCount;
353 SYSTEM_DRIVER_INFO DriverInfo[1];
354 } SYSTEM_DRIVERS_INFO, *PSYSTEM_DRIVERS_INFO;
355
356 #pragma pack(4)
357 typedef struct _SYSTEM_TIME_ADJUSTMENT
358 {
359 TIME TimeAdjustment;
360 BOOL TimeAdjustmentDisabled;
361
362 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
363
364 typedef struct _SYSTEM_CONFIGURATION_INFO {
365 union {
366 ULONG OemId;
367 struct {
368 WORD ProcessorArchitecture;
369 WORD Reserved;
370 } tag1;
371 } tag2;
372 ULONG PageSize;
373 PVOID MinimumApplicationAddress;
374 PVOID MaximumApplicationAddress;
375 ULONG ActiveProcessorMask;
376 ULONG NumberOfProcessors;
377 ULONG ProcessorType;
378 ULONG AllocationGranularity;
379 WORD ProcessorLevel;
380 WORD ProcessorRevision;
381 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
382
383
384 typedef struct _SYSTEM_PAGEFILE_INFORMATION
385 {
386 DWORD Unknown [6];
387 WCHAR PagefileName [16];
388
389 } SYSTEM_PAGEFILE_INFORMATION, * PSYSTEM_PAGEFILE_INFORMATION;
390
391
392 typedef struct _SYSTEM_CACHE_INFORMATION
393 {
394 ULONG CurrentSize;
395 ULONG PeakSize;
396 ULONG PageFaultCount;
397 ULONG MinimumWorkingSet;
398 ULONG MaximumWorkingSet;
399 ULONG Unused[4];
400 } SYSTEM_CACHE_INFORMATION;
401
402
403 /* SYSTEM_POOL_ENTRY_INFO, SYSTEM_POOL_INFORMATION
404 * found by Klaus P. Gerlicher */
405 typedef
406 struct _SYSTEM_POOL_ENTRY_INFO
407 {
408 ULONG Tag;
409 ULONG NP_Allocs;
410 ULONG NP_Frees;
411 ULONG NP_Used;
412 ULONG P_Allocs;
413 ULONG P_Frees;
414 ULONG P_Used;
415
416 } SYSTEM_POOL_ENTRY_INFO, * PSYSTEM_POOL_ENTRY_INFO;
417
418
419 typedef
420 struct _SYSTEM_POOL_INFORMATION
421 {
422 ULONG Count;
423 SYSTEM_POOL_ENTRY_INFO PoolEntry [1];
424
425 } SYSTEM_POOL_INFORMATION, *PSYSTEM_POOL_INFORMATION;
426
427 #endif
428
429 // file information
430
431 typedef struct _FILE_BASIC_INFORMATION
432 {
433 TIME CreationTime;
434 TIME LastAccessTime;
435 TIME LastWriteTime;
436 TIME ChangeTime;
437 ULONG FileAttributes;
438 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
439
440 typedef struct _FILE_STANDARD_INFORMATION
441 {
442 LARGE_INTEGER AllocationSize;
443 LARGE_INTEGER EndOfFile;
444 ULONG NumberOfLinks;
445 BOOLEAN DeletePending;
446 BOOLEAN Directory;
447 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
448
449 typedef struct _FILE_POSITION_INFORMATION
450 {
451 LARGE_INTEGER CurrentByteOffset;
452 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
453
454 typedef struct _FILE_ALIGNMENT_INFORMATION
455 {
456 ULONG AlignmentRequirement;
457 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
458
459 typedef struct _FILE_DISPOSITION_INFORMATION
460 {
461 BOOLEAN DeleteFile;
462 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
463
464 typedef struct _FILE_END_OF_FILE_INFORMATION
465 {
466 LARGE_INTEGER EndOfFile;
467 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
468
469 typedef struct _FILE_NETWORK_OPEN_INFORMATION
470 {
471 TIME CreationTime;
472 TIME LastAccessTime;
473 TIME LastWriteTime;
474 TIME ChangeTime;
475 LARGE_INTEGER AllocationSize;
476 LARGE_INTEGER EndOfFile;
477 ULONG FileAttributes;
478 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
479
480 typedef struct _FILE_FULL_EA_INFORMATION
481 {
482 ULONG NextEntryOffset;
483 UCHAR Flags;
484 UCHAR EaNameLength;
485 USHORT EaValueLength;
486 CHAR EaName[0];
487 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
488
489
490 typedef struct _FILE_EA_INFORMATION {
491 ULONG EaSize;
492 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
493
494
495 typedef struct _FILE_GET_EA_INFORMATION {
496 ULONG NextEntryOffset;
497 UCHAR EaNameLength;
498 CHAR EaName[0];
499 } FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION;
500
501 typedef struct _FILE_STREAM_INFORMATION {
502 ULONG NextEntryOffset;
503 ULONG StreamNameLength;
504 LARGE_INTEGER StreamSize;
505 LARGE_INTEGER StreamAllocationSize;
506 WCHAR StreamName[0];
507 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
508
509 typedef struct _FILE_ALLOCATION_INFORMATION {
510 LARGE_INTEGER AllocationSize;
511 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
512
513 typedef struct _FILE_NAME_INFORMATION {
514 ULONG FileNameLength;
515 WCHAR FileName[0];
516 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
517
518 typedef struct _FILE_NAMES_INFORMATION
519 {
520 ULONG NextEntryOffset;
521 ULONG FileIndex;
522 ULONG FileNameLength;
523 WCHAR FileName[0];
524 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
525
526
527 typedef struct _FILE_RENAME_INFORMATION {
528 BOOLEAN Replace;
529 HANDLE RootDir;
530 ULONG FileNameLength;
531 WCHAR FileName[0];
532 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
533
534
535 typedef struct _FILE_INTERNAL_INFORMATION {
536 LARGE_INTEGER IndexNumber;
537 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
538
539 typedef struct _FILE_ACCESS_INFORMATION {
540 ACCESS_MASK AccessFlags;
541 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
542
543
544 typedef struct _FILE_MODE_INFORMATION {
545 ULONG Mode;
546 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
547
548 typedef struct _FILE_COMPRESSION_INFORMATION {
549 LARGE_INTEGER CompressedFileSize;
550 USHORT CompressionFormat;
551 UCHAR CompressionUnitShift;
552 UCHAR ChunkShift;
553 UCHAR ClusterShift;
554 UCHAR Reserved[3];
555 } FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION;
556
557 typedef struct _FILE_ALL_INFORMATION {
558 FILE_BASIC_INFORMATION BasicInformation;
559 FILE_STANDARD_INFORMATION StandardInformation;
560 FILE_INTERNAL_INFORMATION InternalInformation;
561 FILE_EA_INFORMATION EaInformation;
562 FILE_ACCESS_INFORMATION AccessInformation;
563 FILE_POSITION_INFORMATION PositionInformation;
564 FILE_MODE_INFORMATION ModeInformation;
565 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
566 FILE_NAME_INFORMATION NameInformation;
567 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
568
569 // file system information structures
570
571 typedef struct _FILE_FS_DEVICE_INFORMATION {
572 DEVICE_TYPE DeviceType;
573 ULONG Characteristics;
574 } FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;
575
576
577 typedef struct _FILE_FS_VOLUME_INFORMATION {
578 TIME VolumeCreationTime;
579 ULONG VolumeSerialNumber;
580 ULONG VolumeLabelLength;
581 BOOLEAN SupportsObjects;
582 WCHAR VolumeLabel[0];
583 } FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
584
585 typedef struct _FILE_FS_SIZE_INFORMATION {
586 LARGE_INTEGER TotalAllocationUnits;
587 LARGE_INTEGER AvailableAllocationUnits;
588 ULONG SectorsPerAllocationUnit;
589 ULONG BytesPerSector;
590 } FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
591
592 typedef struct _FILE_FS_ATTRIBUTE_INFORMATION {
593 ULONG FileSystemAttributes;
594 LONG MaximumComponentNameLength;
595 ULONG FileSystemNameLength;
596 WCHAR FileSystemName[0];
597 } FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
598
599 /*
600 FileSystemAttributes is one of the following values:
601
602 FILE_CASE_SENSITIVE_SEARCH 0x00000001
603 FILE_CASE_PRESERVED_NAMES 0x00000002
604 FILE_UNICODE_ON_DISK 0x00000004
605 FILE_PERSISTENT_ACLS 0x00000008
606 FILE_FILE_COMPRESSION 0x00000010
607 FILE_VOLUME_QUOTAS 0x00000020
608 FILE_VOLUME_IS_COMPRESSED 0x00008000
609 */
610 typedef struct _FILE_FS_LABEL_INFORMATION {
611 ULONG VolumeLabelLength;
612 WCHAR VolumeLabel[0];
613 } FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION;
614
615 // read file scatter / write file scatter
616 //FIXME I am a win32 struct aswell
617
618 typedef union _FILE_SEGMENT_ELEMENT {
619 PVOID Buffer;
620 ULONG Alignment;
621 }FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT;
622
623 // directory information
624
625 typedef struct _OBJDIR_INFORMATION {
626 UNICODE_STRING ObjectName;
627 UNICODE_STRING ObjectTypeName; // Directory, Device ...
628 UCHAR Data[0];
629 } OBJDIR_INFORMATION, *POBJDIR_INFORMATION;
630
631
632 typedef struct _FILE_DIRECTORY_INFORMATION {
633 ULONG NextEntryOffset;
634 ULONG FileIndex;
635 TIME CreationTime;
636 TIME LastAccessTime;
637 TIME LastWriteTime;
638 TIME ChangeTime;
639 LARGE_INTEGER EndOfFile;
640 LARGE_INTEGER AllocationSize;
641 ULONG FileAttributes;
642 ULONG FileNameLength;
643 WCHAR FileName[0];
644 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
645
646 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
647 ULONG NextEntryOffset;
648 ULONG FileIndex;
649 TIME CreationTime;
650 TIME LastAccessTime;
651 TIME LastWriteTime;
652 TIME ChangeTime;
653 LARGE_INTEGER EndOfFile;
654 LARGE_INTEGER AllocationSize;
655 ULONG FileAttributes;
656 ULONG FileNameLength;
657 ULONG EaSize;
658 WCHAR FileName[0]; // variable size
659 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
660 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
661
662
663 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
664 ULONG NextEntryOffset;
665 ULONG FileIndex;
666 TIME CreationTime;
667 TIME LastAccessTime;
668 TIME LastWriteTime;
669 TIME ChangeTime;
670 LARGE_INTEGER EndOfFile;
671 LARGE_INTEGER AllocationSize;
672 ULONG FileAttributes;
673 ULONG FileNameLength;
674 ULONG EaSize;
675 CHAR ShortNameLength;
676 WCHAR ShortName[12]; // 8.3 name
677 WCHAR FileName[0];
678 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
679 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
680
681
682 /*
683 NotifyFilter / CompletionFilter:
684
685 FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
686 FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
687 FILE_NOTIFY_CHANGE_NAME 0x00000003
688 FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
689 FILE_NOTIFY_CHANGE_SIZE 0x00000008
690 FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
691 FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
692 FILE_NOTIFY_CHANGE_CREATION 0x00000040
693 FILE_NOTIFY_CHANGE_EA 0x00000080
694 FILE_NOTIFY_CHANGE_SECURITY 0x00000100
695 FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
696 FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
697 FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
698 */
699
700 typedef struct _FILE_NOTIFY_INFORMATION {
701 ULONG Action;
702 ULONG FileNameLength;
703 WCHAR FileName[0];
704 } FILE_NOTIFY_INFORMATION;
705
706
707 /*
708 Action is one of the following values:
709
710 FILE_ACTION_ADDED 0x00000001
711 FILE_ACTION_REMOVED 0x00000002
712 FILE_ACTION_MODIFIED 0x00000003
713 FILE_ACTION_RENAMED_OLD_NAME 0x00000004
714 FILE_ACTION_RENAMED_NEW_NAME 0x00000005
715 FILE_ACTION_ADDED_STREAM 0x00000006
716 FILE_ACTION_REMOVED_STREAM 0x00000007
717 FILE_ACTION_MODIFIED_STREAM 0x00000008
718
719 */
720
721
722 //FIXME: I am a win32 object
723 typedef
724 VOID
725 (*PTIMERAPCROUTINE)(
726 LPVOID lpArgToCompletionRoutine,
727 DWORD dwTimerLowValue,
728 DWORD dwTimerHighValue
729 );
730
731
732 // File System Control commands ( related to defragging )
733
734 #define FSCTL_READ_MFT_RECORD 0x90068 // NTFS only
735 #define FSCTL_GET_VOLUME_BITMAP 0x9006F
736 #define FSCTL_GET_RETRIEVAL_POINTERS 0x90073
737 #define FSCTL_MOVE_FILE 0x90074
738
739 typedef struct _MAPPING_PAIR
740 {
741 ULONGLONG Vcn;
742 ULONGLONG Lcn;
743 } MAPPING_PAIR, *PMAPPING_PAIR;
744
745 typedef struct _GET_RETRIEVAL_DESCRIPTOR
746 {
747 ULONG NumberOfPairs;
748 ULONGLONG StartVcn;
749 MAPPING_PAIR Pair[0]; // variable size
750 } GET_RETRIEVAL_DESCRIPTOR, *PGET_RETRIEVAL_DESCRIPTOR;
751
752 typedef struct _BITMAP_DESCRIPTOR
753 {
754 ULONGLONG StartLcn;
755 ULONGLONG ClustersToEndOfVol;
756 BYTE Map[0]; // variable size
757 } BITMAP_DESCRIPTOR, *PBITMAP_DESCRIPTOR;
758
759 typedef struct _MOVEFILE_DESCRIPTOR
760 {
761 HANDLE FileHandle;
762 ULONG Reserved;
763 LARGE_INTEGER StartVcn;
764 LARGE_INTEGER TargetLcn;
765 ULONG NumVcns;
766 ULONG Reserved1;
767 } MOVEFILE_DESCRIPTOR, *PMOVEFILE_DESCRIPTOR;
768
769
770 // semaphore information
771
772 typedef struct _SEMAPHORE_BASIC_INFORMATION
773 {
774 ULONG CurrentCount;
775 ULONG MaximumCount;
776 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
777
778 // event information
779
780 typedef struct _EVENT_BASIC_INFORMATION
781 {
782 BOOL AutomaticReset;
783 BOOL Signaled;
784 } EVENT_BASIC_INFORMATION, *PEVENT_INFORMATION;
785
786 //typedef enum _TIMER_TYPE
787 //{
788 // NotificationTimer,
789 // SynchronizationTimer
790 //} TIMER_TYPE;
791
792 typedef
793 struct _LPC_PORT_BASIC_INFORMATION
794 {
795 DWORD Unknown0;
796 DWORD Unknown1;
797 DWORD Unknown2;
798 DWORD Unknown3;
799 DWORD Unknown4;
800 DWORD Unknown5;
801 DWORD Unknown6;
802 DWORD Unknown7;
803 DWORD Unknown8;
804 DWORD Unknown9;
805 DWORD Unknown10;
806 DWORD Unknown11;
807 DWORD Unknown12;
808 DWORD Unknown13;
809
810 } LPC_PORT_BASIC_INFORMATION, * PLPC_PORT_BASIC_INFORMATION;
811
812 #endif