Modified: trunk/reactos/include/napi/shared_data.h
Modified: trunk/reactos/include/napi/types.h
Modified: trunk/reactos/include/ntos/obtypes.h
Added: trunk/reactos/include/reactos/helper.h
Modified: trunk/reactos/w32api/include/ddk/ntifs.h
Modified: trunk/reactos/w32api/include/ddk/winddk.h
Modified: trunk/reactos/w32api/include/ntdef.h
--- trunk/reactos/include/napi/shared_data.h 2005-06-19 07:11:38 UTC (rev 16077)
+++ trunk/reactos/include/napi/shared_data.h 2005-06-19 07:11:49 UTC (rev 16078)
@@ -13,6 +13,8 @@
#define PF_PAE_ENABLED 9
#define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10
+#ifndef __USE_W32API
+
#ifndef __ASM__
typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
@@ -72,6 +74,7 @@
} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
#endif
+#endif
/* Values for DosDeviceDriveType */
#define DOSDEVICE_DRIVE_UNKNOWN 0
--- trunk/reactos/include/napi/types.h 2005-06-19 07:11:38 UTC (rev 16077)
+++ trunk/reactos/include/napi/types.h 2005-06-19 07:11:49 UTC (rev 16078)
@@ -12,8 +12,8 @@
DIRECTORY_CREATE_SUBDIRECTORY,
DIRECTORY_ALL_ACCESS,
};
-#endif
+
/*
* General type for status information
*/
@@ -24,7 +24,7 @@
NtProductLanManNt,
NtProductServer
} NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
-
+#endif
typedef ULARGE_INTEGER TIME, *PTIME;
#ifndef __USE_W32API
--- trunk/reactos/include/ntos/obtypes.h 2005-06-19 07:11:38 UTC (rev 16077)
+++ trunk/reactos/include/ntos/obtypes.h 2005-06-19 07:11:49 UTC (rev 16078)
@@ -87,6 +87,8 @@
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
+#endif
+
typedef struct _HANDLE_TABLE_ENTRY_INFO {
ULONG AuditMask;
} HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO;
@@ -105,8 +107,6 @@
} u2;
} HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY;
-#endif /* __USE_W32API */
-
typedef struct _HANDLE_TABLE
{
ULONG Flags;
--- trunk/reactos/include/reactos/helper.h 2005-06-19 07:11:38 UTC (rev 16077)
+++ trunk/reactos/include/reactos/helper.h 2005-06-19 07:11:49 UTC (rev 16078)
@@ -0,0 +1,37 @@
+#ifndef _HELPER_H
+#define _HELPER_H
+
+#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
+#define ROUNDDOWN(a,b) (((a)/(b))*(b))
+#define ROUND_UP ROUNDUP
+#define ROUND_DOWN ROUNDDOWN
+#define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~(PAGE_SIZE-1)))
+#define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGE_SIZE) ? ((((ULONG)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG)x) )
+#define ABS_VALUE(V) (((V) < 0) ? -(V) : (V))
+#define RtlRosMin(X,Y) (((X) < (Y))? (X) : (Y))
+#define RtlRosMin3(X,Y,Z) (((X) < (Y)) ? RtlRosMin(X,Z) : RtlRosMin(Y,Z))
+#define KEBUGCHECKEX(a,b,c,d,e) DbgPrint("KeBugCheckEx at %s:%i\n",__FILE__,__LINE__), KeBugCheckEx(a,b,c,d,e)
+#define KEBUGCHECK(a) DbgPrint("KeBugCheck at %s:%i\n",__FILE__,__LINE__), KeBugCheck(a)
+#define EXPORTED __declspec(dllexport)
+#define IMPORTED __declspec(dllimport)
+#define LIST_FOR_EACH(entry, head) \
+ for(entry = (head)->Flink; entry != (head); entry = entry->Flink)
+#define LIST_FOR_EACH_SAFE(tmp_entry, head, ptr, type, field) \
+ for ((tmp_entry)=(head)->Flink; (tmp_entry)!=(head) && \
+ ((ptr) = CONTAINING_RECORD(tmp_entry,type,field)) && \
+ ((tmp_entry) = (tmp_entry)->Flink); )
+#define OPTHDROFFSET(a) ((LPVOID)((BYTE *)a + \
+ ((PIMAGE_DOS_HEADER)a)->e_lfanew + \
+ sizeof (IMAGE_NT_SIGNATURE) + \
+ sizeof (IMAGE_FILE_HEADER)))
+#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
+#define RVA(m, b) ((ULONG)b + m)
+#define NTSTAT_SEVERITY_SHIFT 30
+#define NTSTAT_SEVERITY_MASK 0x00000003
+#define NTSTAT_FACILITY_SHIFT 16
+#define NTSTAT_FACILITY_MASK 0x00000FFF
+#define NTSTAT_CUSTOMER_MASK 0x20000000
+#define NT_SEVERITY(StatCode) (((StatCode) >> NTSTAT_SEVERITY_SHIFT) & NTSTAT_SEVERITY_MASK)
+#define NT_FACILITY(StatCode) (((StatCode) >> NTSTAT_FACILITY_SHIFT) & NTSTAT_FACILITY_MASK)
+#define NT_CUSTOMER(StatCode) ((StatCode) & NTSTAT_CUSTOMER_MASK)
+#endif
--- trunk/reactos/w32api/include/ddk/ntifs.h 2005-06-19 07:11:38 UTC (rev 16077)
+++ trunk/reactos/w32api/include/ddk/ntifs.h 2005-06-19 07:11:49 UTC (rev 16078)
@@ -1250,25 +1250,6 @@
ULONG LastIndexValue;
} GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
-typedef struct _HANDLE_TABLE_ENTRY_INFO {
- ULONG AuditMask;
-} HANDLE_TABLE_ENTRY_INFO, *PHANDLE_TABLE_ENTRY_INFO;
-
-typedef struct _HANDLE_TABLE_ENTRY {
- union {
- PVOID Object;
- ULONG ObAttributes;
- PHANDLE_TABLE_ENTRY_INFO InfoTable;
- ULONG_PTR Value;
- } u1;
- union {
- ULONG GrantedAccess;
- USHORT GrantedAccessIndex;
- LONG NextFreeTableEntry;
- } u2;
- USHORT CreatorBackTraceIndex;
-} HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY;
-
typedef struct _MAPPING_PAIR {
ULONGLONG Vcn;
ULONGLONG Lcn;
--- trunk/reactos/w32api/include/ddk/winddk.h 2005-06-19 07:11:38 UTC (rev 16077)
+++ trunk/reactos/w32api/include/ddk/winddk.h 2005-06-19 07:11:49 UTC (rev 16078)
@@ -122,10 +122,8 @@
/*
** Routines specific to this DDK
*/
+#define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 )
-#define TAG(_a, _b, _c, _d) (ULONG) \
- (((_a) << 0) + ((_b) << 8) + ((_c) << 16) + ((_d) << 24))
-
static __inline struct _KPCR * KeGetCurrentKPCR(
VOID)
{
@@ -350,7 +348,64 @@
extern NTOSAPI CCHAR KeNumberProcessors;
+#define PROCESSOR_FEATURE_MAX 64
+typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
+{
+ StandardDesign,
+ NEC98x86,
+ EndAlternatives
+} ALTERNATIVE_ARCHITECTURE_TYPE;
+
+typedef struct _KSYSTEM_TIME
+{
+ ULONG LowPart;
+ LONG High1Time;
+ LONG High2Time;
+} KSYSTEM_TIME, *PKSYSTEM_TIME;
+
+typedef struct _KUSER_SHARED_DATA
+{
+ ULONG TickCountLowDeprecated;
+ ULONG TickCountMultiplier;
+ volatile KSYSTEM_TIME InterruptTime;
+ volatile KSYSTEM_TIME SystemTime;
+ volatile KSYSTEM_TIME TimeZoneBias;
+ USHORT ImageNumberLow;
+ USHORT ImageNumberHigh;
+ WCHAR NtSystemRoot[ 260 ];
+ ULONG MaxStackTraceDepth;
+ ULONG CryptoExponent;
+ ULONG TimeZoneId;
+ ULONG LargePageMinimum;
+ ULONG Reserved2[ 7 ];
+ NT_PRODUCT_TYPE NtProductType;
+ BOOLEAN ProductTypeIsValid;
+ ULONG NtMajorVersion;
+ ULONG NtMinorVersion;
+ BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
+ ULONG Reserved1;
+ ULONG Reserved3;
+ volatile ULONG TimeSlip;
+ ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
+ LARGE_INTEGER SystemExpirationDate;
+ ULONG SuiteMask;
+ BOOLEAN KdDebuggerEnabled;
+ volatile ULONG ActiveConsoleId;
+ volatile ULONG DismountCount;
+ ULONG ComPlusPackage;
+ ULONG LastSystemRITEventTickCount;
+ ULONG NumberOfPhysicalPages;
+ BOOLEAN SafeBootMode;
+ ULONG TraceLogging;
+ ULONGLONG Fill0;
+ ULONGLONG SystemCall[4];
+ union {
+ volatile KSYSTEM_TIME TickCount;
+ volatile ULONG64 TickCountQuad;
+ };
+} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
+
/*
** IRP function codes
*/
@@ -3393,6 +3448,10 @@
MaxKeySetInfoClass
} KEY_SET_INFORMATION_CLASS;
+#define REG_CREATED_NEW_KEY 0x00000001L
+#define REG_OPENED_EXISTING_KEY 0x00000002L
+
+
/* KEY_VALUE_Xxx.Type */
#define REG_NONE 0
@@ -8400,6 +8459,12 @@
DDKAPI
KeRaiseIrqlToDpcLevel(
VOID);
+
+NTHALAPI
+KIRQL
+DDKAPI
+KeRaiseIrqlToSynchLevel(
+ VOID);
#define KeLowerIrql(a) KfLowerIrql(a)
#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
--- trunk/reactos/w32api/include/ntdef.h 2005-06-19 07:11:38 UTC (rev 16077)
+++ trunk/reactos/w32api/include/ntdef.h 2005-06-19 07:11:49 UTC (rev 16078)
@@ -52,6 +52,11 @@
ViewShare = 1,
ViewUnmap = 2
} SECTION_INHERIT;
+typedef enum _NT_PRODUCT_TYPE {
+ NtProductWinNt = 1,
+ NtProductLanManNt,
+ NtProductServer
+} NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
#if !defined(_NTSECAPI_H)
typedef struct _OBJECT_ATTRIBUTES {
ULONG Length;