|
|
1.1 root 1: /*++ BUILD Version: 0047 // Increment this if a change has global effects
2:
3: Copyright (c) 1990 Microsoft Corporation
4:
5: Module Name:
6:
7: winnt.h
8:
9: Abstract:
10:
11: This module defines the 32-Bit Windows types and constants that are
12: defined by NT, but exposed through the Win32 API.
13:
14: Created:
15:
16: 18-Sep-1990
17:
18: Revision History:
19:
20: --*/
21:
22: #ifndef _WINNT_
23: #define _WINNT_
24:
25: #ifdef MIPS
26: #define UNALIGNED __unaligned
27: #else
28: #define UNALIGNED
29: #endif
30: typedef void *PVOID;
31:
32: //
33: // Basics
34: //
35:
36: #ifndef VOID
37: #define VOID void
38: typedef char CHAR;
39: typedef short SHORT;
40: typedef long LONG;
41: #endif
42:
43: //
44: // UNICODE
45: //
46:
47: typedef unsigned short WCHAR; // wc, 16-bit UNICODE character
48: typedef WCHAR *LPWCH, *PWCH; // pwc
49: typedef WCHAR *LPWSTR, *PWSTR; // pwsz, 0x0000 terminated UNICODE strings only
50:
51:
52: //
53: // Portable UNICODE types and macros
54: //
55:
56: #ifdef UNICODE
57: typedef WCHAR TCHAR;
58: #define TEXT(quote) L##quote
59: #else
60: typedef char TCHAR;
61: #define TEXT(quote) quote
62: #endif
63:
64: typedef TCHAR *LPTSTR;
65:
66: typedef SHORT *PSHORT;
67: typedef LONG *PLONG;
68: typedef PVOID HANDLE;
69: typedef HANDLE *PHANDLE;
70: #define UNICODE_NULL ((WCHAR)0)
71: #define MINCHAR 0x80
72: #define MAXCHAR 0x7f
73: #define MINSHORT 0x8000
74: #define MAXSHORT 0x7fff
75: #define MINLONG 0x80000000
76: #define MAXLONG 0x7fffffff
77: #define MAXBYTE 0xff
78: #define MAXWORD 0xffff
79: #define MAXDWORD 0xffffffff
80:
81: //
82: // Macros used to eliminate compiler warning generated when formal
83: // parameters or local variables are not declared.
84: //
85: // Use DBG_UNREFERENCED_PARAMETER() when a parameter is not yet
86: // referenced but will be once the module is completely developed.
87: //
88: // Use DBG_UNREFERENCED_LOCAL_VARIABLE() when a local variable is not yet
89: // referenced but will be once the module is completely developed.
90: //
91: // Use UNREFERENCED_PARAMETER() if a parameter will never be referenced.
92: //
93: // DBG_UNREFERENCED_PARAMETER and DBG_UNREFERENCED_LOCAL_VARIABLE will
94: // eventually be made into a null macro to help determine whether there
95: // is unfinished work.
96: //
97:
98: #if ! (defined(lint) || defined(_lint))
99: #define UNREFERENCED_PARAMETER(P) (P)
100: #define DBG_UNREFERENCED_PARAMETER(P) (P)
101: #define DBG_UNREFERENCED_LOCAL_VARIABLE(V) (V)
102:
103: #else // lint or _lint
104:
105: // Note: lint -e530 says don't complain about uninitialized variables for
106: // this. line +e530 turns that checking back on. Error 527 has to do with
107: // unreachable code.
108:
109: #define UNREFERENCED_PARAMETER(P) \
110: /*lint -e527 -e530 */ \
111: { \
112: (P) = (P); \
113: } \
114: /*lint +e527 +e530 */
115: #define DBG_UNREFERENCED_PARAMETER(P) \
116: /*lint -e527 -e530 */ \
117: { \
118: (P) = (P); \
119: } \
120: /*lint +e527 +e530 */
121: #define DBG_UNREFERENCED_LOCAL_VARIABLE(V) \
122: /*lint -e527 -e530 */ \
123: { \
124: (V) = (V); \
125: } \
126: /*lint +e527 +e530 */
127:
128: #endif // lint or _lint
129:
130:
131: /*lint -e767 */ // Don't complain about different definitions
132: #define STATUS_WAIT_0 ((DWORD )0x00000000L)
133: #define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L)
134: #define STATUS_TIMEOUT ((DWORD )0x00000102L)
135: #define STATUS_PENDING ((DWORD )0x00000103L)
136: #define STATUS_DATATYPE_MISALIGNMENT ((DWORD )0x80000002L)
137: #define STATUS_BREAKPOINT ((DWORD )0x80000003L)
138: #define STATUS_SINGLE_STEP ((DWORD )0x80000004L)
139: #define STATUS_ACCESS_VIOLATION ((DWORD )0xC0000005L)
140: #define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD )0xC0000025L)
141: #define STATUS_CONTROL_C_EXIT ((DWORD )0xC000013AL)
142: /*lint +e767 */ // Resume checking for different macro definitions
143: #define MAXIMUM_WAIT_OBJECTS 64 // Maximum number of wait objects
144:
145: #define MAXIMUM_SUSPEND_COUNT MAXCHAR // Maximum times thread can be suspended
146: typedef DWORD KSPIN_LOCK;
147:
148: #ifdef i386
149:
150: //
151: // Define the size of the 80387 save area, which is in the context frame.
152: //
153:
154: #define SIZE_OF_80387_ENVIRONMENT 108
155: #define SIZE_OF_80387_REGISTERS 80
156:
157: //
158: // The following flags control the contents of the CONTEXT structure.
159: //
160:
161: #define CONTEXT_i386 0x00010000 // this assumes that i386 and
162: #define CONTEXT_i486 0x00010000 // i486 have identical context records
163:
164: #define CONTEXT_CONTROL (CONTEXT_i386 | 0x00000001L) // SS:SP, CS:IP, FLAGS, BP
165: #define CONTEXT_INTEGER (CONTEXT_i386 | 0x00000002L) // AX, BX, CX, DX, SI, DI
166: #define CONTEXT_SEGMENTS (CONTEXT_i386 | 0x00000004L) // DS, ES, FS, GS
167: #define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 0x00000008L) // 387 state
168: #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x00000010L) // DB 0-3,6,7
169:
170: #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER |\
171: CONTEXT_SEGMENTS)
172:
173: typedef struct _FLOATING_SAVE_AREA {
174: DWORD ControlWord;
175: DWORD StatusWord;
176: DWORD TagWord;
177: DWORD ErrorOffset;
178: DWORD ErrorSelector;
179: DWORD DataOffset;
180: DWORD DataSelector;
181: BYTE RegisterArea[SIZE_OF_80387_REGISTERS];
182: } FLOATING_SAVE_AREA;
183:
184: typedef FLOATING_SAVE_AREA *PFLOATING_SAVE_AREA;
185:
186: //
187: // Context Frame
188: //
189: // This frame has a several purposes: 1) it is used as an argument to
190: // NtContinue, 2) is is used to constuct a call frame for APC delivery,
191: // and 3) it is used in the user level thread creation routines.
192: //
193: // The layout of the record conforms to a standard call frame.
194: //
195:
196: typedef struct _CONTEXT {
197:
198: //
199: // The flags values within this flag control the contents of
200: // a CONTEXT record.
201: //
202: // If the context record is used as an input parameter, then
203: // for each portion of the context record controlled by a flag
204: // whose value is set, it is assumed that that portion of the
205: // context record contains valid context. If the context record
206: // is being used to modify a threads context, then only that
207: // portion of the threads context will be modified.
208: //
209: // If the context record is used as an IN OUT parameter to capture
210: // the context of a thread, then only those portions of the thread's
211: // context corresponding to set flags will be returned.
212: //
213: // The context record is never used as an OUT only parameter.
214: //
215:
216: DWORD ContextFlags;
217:
218: //
219: // This section is specified/returned if CONTEXT_DEBUG_REGISTERS is
220: // set in ContextFlags. Note that CONTEXT_DEBUG_REGISTERS is NOT
221: // included in CONTEXT_FULL.
222: //
223:
224: DWORD Dr0;
225: DWORD Dr1;
226: DWORD Dr2;
227: DWORD Dr3;
228: DWORD Dr6;
229: DWORD Dr7;
230:
231: //
232: // This section is specified/returned if the
233: // ContextFlags word contians the flag CONTEXT_FLOATING_POINT.
234: //
235:
236: FLOATING_SAVE_AREA FloatSave;
237:
238: //
239: // This section is specified/returned if the
240: // ContextFlags word contians the flag CONTEXT_SEGMENTS.
241: //
242:
243: DWORD SegGs;
244: DWORD SegFs;
245: DWORD SegEs;
246: DWORD SegDs;
247:
248: //
249: // This section is specified/returned if the
250: // ContextFlags word contians the flag CONTEXT_INTEGER.
251: //
252:
253: DWORD Edi;
254: DWORD Esi;
255: DWORD Ebx;
256: DWORD Edx;
257: DWORD Ecx;
258: DWORD Eax;
259:
260: //
261: // This section is specified/returned if the
262: // ContextFlags word contians the flag CONTEXT_CONTROL.
263: //
264:
265: DWORD Ebp;
266: DWORD Eip;
267: DWORD SegCs; // MUST BE SANITIZED
268: DWORD EFlags; // MUST BE SANITIZED
269: DWORD Esp;
270: DWORD SegSs;
271:
272: } CONTEXT;
273:
274:
275:
276: typedef CONTEXT *PCONTEXT;
277:
278: #endif // i386
279:
280: typedef struct _LDT_ENTRY {
281: WORD LimitLow;
282: WORD BaseLow;
283: union {
284: struct {
285: BYTE BaseMid;
286: BYTE Flags1; // Declare as bytes to avoid alignment
287: BYTE Flags2; // Problems.
288: BYTE BaseHi;
289: } Bytes;
290: struct {
291: DWORD BaseMid : 8;
292: DWORD Type : 5;
293: DWORD Dpl : 2;
294: DWORD Pres : 1;
295: DWORD LimitHi : 4;
296: DWORD Sys : 1;
297: DWORD Reserved_0 : 1;
298: DWORD Default_Big : 1;
299: DWORD Granularity : 1;
300: DWORD BaseHi : 8;
301: } Bits;
302: } HighWord;
303: } LDT_ENTRY, *PLDT_ENTRY;
304:
305:
306: #ifdef MIPS
307:
308: //
309: // The following flags control the contents of the CONTEXT structure.
310: //
311:
312: #define CONTEXT_R3000 0x00010000 // this assumes that r3000 and
313: #define CONTEXT_R4000 0x00010000 // r4000 have identical context records
314:
315: #define CONTEXT_CONTROL (CONTEXT_R3000 | 0x00000001L)
316: #define CONTEXT_FLOATING_POINT (CONTEXT_R3000 | 0x00000002L)
317: #define CONTEXT_INTEGER (CONTEXT_R3000 | 0x00000004L)
318:
319: #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
320:
321: //
322: // Context Frame
323: //
324: // N.B. This frame must be exactly a multiple of 16 bytes in length.
325: //
326: // This frame has a several purposes: 1) it is used as an argument to
327: // NtContinue, 2) it is used to constuct a call frame for APC delivery,
328: // 3) it is used to construct a call frame for exception dispatching
329: // in user mode, and 4) it is used in the user level thread creation
330: // routines.
331: //
332: // The layout of the record conforms to a standard call frame.
333: //
334:
335: typedef struct _CONTEXT {
336:
337: //
338: // This section is always present and is used as an argument build
339: // area.
340: //
341:
342: DWORD Argument[4];
343:
344: //
345: // This section is specified/returned if the ContextFlags word contains
346: // the flag CONTEXT_FLOATING_POINT.
347: //
348:
349: DWORD FltF0;
350: DWORD FltF1;
351: DWORD FltF2;
352: DWORD FltF3;
353: DWORD FltF4;
354: DWORD FltF5;
355: DWORD FltF6;
356: DWORD FltF7;
357: DWORD FltF8;
358: DWORD FltF9;
359: DWORD FltF10;
360: DWORD FltF11;
361: DWORD FltF12;
362: DWORD FltF13;
363: DWORD FltF14;
364: DWORD FltF15;
365: DWORD FltF16;
366: DWORD FltF17;
367: DWORD FltF18;
368: DWORD FltF19;
369: DWORD FltF20;
370: DWORD FltF21;
371: DWORD FltF22;
372: DWORD FltF23;
373: DWORD FltF24;
374: DWORD FltF25;
375: DWORD FltF26;
376: DWORD FltF27;
377: DWORD FltF28;
378: DWORD FltF29;
379: DWORD FltF30;
380: DWORD FltF31;
381:
382: //
383: // This section is specified/returned if the ContextFlags word contains
384: // the flag CONTEXT_INTEGER.
385: //
386: // N.B. The registers gp, sp, and ra are defined in this section, but are
387: // considered part of the control context rather than part of the integer
388: // context.
389: //
390: // N.B. Register zero is not stored in the frame.
391: //
392:
393: DWORD IntZero;
394: DWORD IntAt;
395: DWORD IntV0;
396: DWORD IntV1;
397: DWORD IntA0;
398: DWORD IntA1;
399: DWORD IntA2;
400: DWORD IntA3;
401: DWORD IntT0;
402: DWORD IntT1;
403: DWORD IntT2;
404: DWORD IntT3;
405: DWORD IntT4;
406: DWORD IntT5;
407: DWORD IntT6;
408: DWORD IntT7;
409: DWORD IntS0;
410: DWORD IntS1;
411: DWORD IntS2;
412: DWORD IntS3;
413: DWORD IntS4;
414: DWORD IntS5;
415: DWORD IntS6;
416: DWORD IntS7;
417: DWORD IntT8;
418: DWORD IntT9;
419: DWORD IntK0;
420: DWORD IntK1;
421: DWORD IntGp;
422: DWORD IntSp;
423: DWORD IntS8;
424: DWORD IntRa;
425: DWORD IntLo;
426: DWORD IntHi;
427:
428: //
429: // This section is specified/returned if the ContextFlags word contains
430: // the flag CONTEXT_FLOATING_POINT.
431: //
432:
433: DWORD Fsr;
434:
435: //
436: // This section is specified/returned if the ContextFlags word contains
437: // the flag CONTEXT_CONTROL.
438: //
439: // N.B. The registers gp, sp, and ra are defined in the integer section,
440: // but are considered part of the control context rather than part of
441: // the integer context.
442: //
443:
444: DWORD Fir;
445: DWORD Psr;
446:
447: //
448: // The flags values within this flag control the contents of
449: // a CONTEXT record.
450: //
451: // If the context record is used as an input parameter, then
452: // for each portion of the context record controlled by a flag
453: // whose value is set, it is assumed that that portion of the
454: // context record contains valid context. If the context record
455: // is being used to modify a thread's context, then only that
456: // portion of the threads context will be modified.
457: //
458: // If the context record is used as an IN OUT parameter to capture
459: // the context of a thread, then only those portions of the thread's
460: // context corresponding to set flags will be returned.
461: //
462: // The context record is never used as an OUT only parameter.
463: //
464:
465: DWORD ContextFlags;
466:
467: DWORD Fill[2];
468: } CONTEXT, *PCONTEXT;
469:
470: #endif // MIPS
471:
472:
473: #ifdef MIPS
474:
475: VOID
476: __jump_unwind (
477: PVOID Fp,
478: PVOID TargetPc
479: );
480:
481: #endif // MIPS
482:
483: #define EXCEPTION_NONCONTINUABLE 0x1 // Noncontinuable exception
484: #define EXCEPTION_MAXIMUM_PARAMETERS 4 // maximum number of exception parameters
485:
486: //
487: // Exception record definition.
488: //
489:
490: typedef struct _EXCEPTION_RECORD {
491: DWORD ExceptionCode;
492: DWORD ExceptionFlags;
493: struct _EXCEPTION_RECORD *ExceptionRecord;
494: PVOID ExceptionAddress;
495: DWORD NumberParameters;
496: DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
497: } EXCEPTION_RECORD;
498:
499: typedef EXCEPTION_RECORD *PEXCEPTION_RECORD;
500:
501: //
502: // Typedef for pointer returned by exception_info()
503: //
504:
505: typedef struct _EXCEPTION_POINTERS {
506: PEXCEPTION_RECORD ExceptionRecord;
507: PCONTEXT ContextRecord;
508: } EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
509: #define PROCESS_TERMINATE (0x0001)
510: #define PROCESS_VM_READ (0x0010)
511: #define PROCESS_VM_WRITE (0x0020)
512: #define PROCESS_DUP_HANDLE (0x0040)
513: #define PROCESS_CREATE_PROCESS (0x0080)
514: #define PROCESS_SET_INFORMATION (0x0200)
515: #define PROCESS_QUERY_INFORMATION (0x0400)
516: #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \
517: 0xFFF)
518: #define THREAD_TERMINATE (0x0001)
519: #define THREAD_SUSPEND_RESUME (0x0002)
520: #define THREAD_GET_CONTEXT (0x0008)
521: #define THREAD_SET_CONTEXT (0x0010)
522: #define THREAD_SET_INFORMATION (0x0020)
523: #define THREAD_QUERY_INFORMATION (0x0040)
524: #define THREAD_SET_THREAD_TOKEN (0x0080)
525: #define THREAD_IMPERSONATE (0x0100)
526: #define THREAD_DIRECT_IMPERSONATION (0x0200)
527: #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \
528: 0x3FF)
529: #define TLS_MINIMUM_AVAILABLE 64
530: #define THREAD_BASE_PRIORITY_MAX 2 // maximum thread base priority boost
531: #define THREAD_BASE_PRIORITY_MIN -2 // minimum thread base priority boost
532: #define EVENT_MODIFY_STATE 0x0002
533: #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
534: #define MUTANT_QUERY_STATE 0x0001
535:
536: #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|\
537: MUTANT_QUERY_STATE)
538: #define SEMAPHORE_MODIFY_STATE 0x0002
539: #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
540:
541: #define PROCESSOR_INTEL_386 386
542: #define PROCESSOR_INTEL_486 486
543: #define PROCESSOR_INTEL_860 860
544: #define PROCESSOR_MIPS_R2000 2000
545: #define PROCESSOR_MIPS_R3000 3000
546: #define PROCESSOR_MIPS_R4000 4000
547:
548: #define PROCESSOR_STEP_A0 0x00000000
549: #define PROCESSOR_STEP_B0 0x00010000
550: #define PROCESSOR_STEP_C0 0x00020000
551: #define PROCESSOR_STEP_D0 0x00030000
552: #define PROCESSOR_STEP_E0 0x00040000
553: #define PROCESSOR_STEP_F0 0x00050000
554: #define PROCESSOR_STEP_G0 0x00060000
555: #define PROCESSOR_STEP_H0 0x00070000
556: #define PROCESSOR_STEP_I0 0x00080000
557:
558: #define PROCESSOR_OPTION_387 0x00000001
559: #define PROCESSOR_OPTION_WEITEK 0x00000002
560:
561: typedef struct _MEMORY_BASIC_INFORMATION {
562: PVOID BaseAddress;
563: PVOID AllocationBase;
564: DWORD AllocationProtect;
565: DWORD RegionSize;
566: DWORD State;
567: DWORD Protect;
568: DWORD Type;
569: } MEMORY_BASIC_INFORMATION;
570: typedef MEMORY_BASIC_INFORMATION *PMEMORY_BASIC_INFORMATION;
571: #define SECTION_QUERY 0x0001
572: #define SECTION_MAP_WRITE 0x0002
573: #define SECTION_MAP_READ 0x0004
574: #define SECTION_MAP_EXECUTE 0x0008
575: #define SECTION_EXTEND_SIZE 0x0010
576:
577: #define SECTION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SECTION_QUERY|\
578: SECTION_MAP_WRITE | \
579: SECTION_MAP_READ | \
580: SECTION_MAP_EXECUTE | \
581: SECTION_EXTEND_SIZE)
582: #define PAGE_NOACCESS 0x01
583: #define PAGE_READONLY 0x02
584: #define PAGE_READWRITE 0x04
585: #define MEM_COMMIT 0x1000
586: #define MEM_RESERVE 0x2000
587: #define MEM_DECOMMIT 0x4000
588: #define MEM_RELEASE 0x8000
589: #define MEM_FREE 0x10000
590: #define MEM_PRIVATE 0x20000
591: #define FILE_SHARE_READ 0x00000001
592: #define FILE_SHARE_WRITE 0x00000002
593: #define FILE_ATTRIBUTE_READONLY 0x00000001
594: #define FILE_ATTRIBUTE_HIDDEN 0x00000002
595: #define FILE_ATTRIBUTE_SYSTEM 0x00000004
596: #define FILE_ATTRIBUTE_ARCHIVE 0x00000020
597: #define FILE_ATTRIBUTE_NORMAL 0x00000080
598: #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
599: #define FILE_CASE_PRESERVED_NAMES 0x00000002
600: #define FILE_UNICODE_ON_DISK 0x00000004
601: #define DUPLICATE_CLOSE_SOURCE 0x00000001
602: #define DUPLICATE_SAME_ACCESS 0x00000002
603: typedef PVOID PSECURITY_DESCRIPTOR;
604: typedef PVOID PSID;
605: typedef DWORD ACCESS_MASK;
606: #define DELETE (0x00010000L)
607: #define READ_CONTROL (0x00020000L)
608: #define WRITE_DAC (0x00040000L)
609: #define WRITE_OWNER (0x00080000L)
610: #define SYNCHRONIZE (0x00100000L)
611:
612: #define STANDARD_RIGHTS_REQUIRED (0x000F0000L)
613:
614: #define STANDARD_RIGHTS_READ (READ_CONTROL)
615: #define STANDARD_RIGHTS_WRITE (READ_CONTROL)
616: #define STANDARD_RIGHTS_EXECUTE (READ_CONTROL)
617:
618: #define STANDARD_RIGHTS_ALL (0x001F0000L)
619:
620: #define SPECIFIC_RIGHTS_ALL (0x0000FFFFL)
621:
622: //
623: // AccessSystemAcl access type
624: //
625:
626: #define ACCESS_SYSTEM_SECURITY (0x01000000L)
627:
628: //
629: // MaximumAllowed access type
630: //
631:
632: #define MAXIMUM_ALLOWED (0x02000000L)
633:
634: //
635: // These are the generic rights.
636: //
637:
638: #define GENERIC_READ (0x80000000L)
639: #define GENERIC_WRITE (0x40000000L)
640: #define GENERIC_EXECUTE (0x20000000L)
641: #define GENERIC_ALL (0x10000000L)
642: // Obsolete definition - not portable.
643: // replaced by DWORD definition below
644: //typedef struct _SECURITY_INFORMATION {
645: // DWORD Owner :1;
646: // DWORD Group :1;
647: // DWORD Dacl :1;
648: // DWORD Sacl :1;
649: // DWORD Reserved :28;
650: // } SECURITY_INFORMATION, *PSECURITY_INFORMATION;
651:
652:
653: typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
654:
655: #define OWNER_SECURITY_INFORMATION (0X00000001L)
656: #define GROUP_SECURITY_INFORMATION (0X00000002L)
657: #define DACL_SECURITY_INFORMATION (0X00000004L)
658: #define SACL_SECURITY_INFORMATION (0X00000008L)
659: #define HEAP_SERIALIZE 0x00000001
660: typedef struct _RTL_CRITICAL_SECTION {
661:
662:
663: PVOID CallingAddress;
664: PVOID CallersCaller;
665: PVOID Spare[5];
666:
667:
668: //
669: // The following three fields control entering and exiting the critical
670: // section for the resource
671: //
672:
673: LONG LockCount;
674: LONG RecursionCount;
675: HANDLE OwningThread; // from the thread's ClientId->UniqueThread
676: HANDLE LockSemaphore;
677: KSPIN_LOCK SpinLock;
678:
679: } RTL_CRITICAL_SECTION;
680: typedef RTL_CRITICAL_SECTION *PRTL_CRITICAL_SECTION;
681: #define DLL_PROCESS_ATTACH 1
682: #define DLL_THREAD_ATTACH 2
683: #define DLL_THREAD_DETACH 3
684: #define DLL_PROCESS_DETACH 0
685:
686: //
687: // Defines for the READ flags for Eventlogging
688: //
689: #define EVENTLOG_SEQUENTIAL_READ 0X0001
690: #define EVENTLOG_SEEK_READ 0X0002
691: #define EVENTLOG_FORWARDS_READ 0X0004
692: #define EVENTLOG_BACKWARDS_READ 0X0008
693:
694: //
695: // The types of events that can be logged.
696: //
697: #define EVENTLOG_ERROR_TYPE 0x0001
698: #define EVENTLOG_WARNING_TYPE 0x0002
699: #define EVENTLOG_INFORMATION_TYPE 0x0003
700:
701: #define DBG_CONTINUE ((DWORD )0x00010002L)
702: #define DBG_TERMINATE_THREAD ((DWORD )0x40010003L)
703: #define DBG_TERMINATE_PROCESS ((DWORD )0x40010004L)
704: #define DBG_CONTROL_C ((DWORD )0x40010005L)
705: #define DBG_EXCEPTION_NOT_HANDLED ((DWORD )0x80010001L)
706:
707: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.