Author: ion
Date: Fri May 19 04:32:50 2006
New Revision: 21942
URL:
http://svn.reactos.ru/svn/reactos?rev=21942&view=rev
Log:
- Use the proper HANDLE_TABLE and HANDLE_TABLE_ENTRY structures.
Modified:
trunk/reactos/include/ndk/extypes.h
trunk/reactos/ntoskrnl/ex/handle.c
trunk/reactos/ntoskrnl/include/internal/ex.h
trunk/reactos/ntoskrnl/ob/handle.c
trunk/reactos/ntoskrnl/ob/wait.c
trunk/reactos/ntoskrnl/ps/process.c
trunk/reactos/ntoskrnl/ps/psmgr.c
trunk/reactos/ntoskrnl/ps/thread.c
trunk/reactos/ntoskrnl/rtl/libsupp.c
Modified: trunk/reactos/include/ndk/extypes.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/ndk/extypes.h?rev=2…
==============================================================================
--- trunk/reactos/include/ndk/extypes.h (original)
+++ trunk/reactos/include/ndk/extypes.h Fri May 19 04:32:50 2006
@@ -467,6 +467,24 @@
//
// Handle Table Structures
//
+typedef struct _HANDLE_TRACE_DB_ENTRY
+{
+ CLIENT_ID ClientId;
+ HANDLE Handle;
+ ULONG Type;
+ PVOID StackTrace[16];
+} HANDLE_TRACE_DB_ENTRY, *PHANDLE_TRACE_DB_ENTRY;
+
+typedef struct _HANDLE_TRACE_DEBUG_INFO
+{
+ LONG RefCount;
+ ULONG TableSize;
+ ULONG BitMaskFlags;
+ FAST_MUTEX CloseCompatcionLock;
+ ULONG CurrentStackIndex;
+ HANDLE_TRACE_DB_ENTRY TraceDb[1];
+} HANDLE_TRACE_DEBUG_INFO, *PHANDLE_TRACE_DEBUG_INFO;
+
typedef struct _HANDLE_TABLE_ENTRY_INFO
{
ULONG AuditMask;
@@ -480,27 +498,60 @@
ULONG_PTR ObAttributes;
PHANDLE_TABLE_ENTRY_INFO InfoTable;
ULONG_PTR Value;
- } u1;
+ };
union
{
ULONG GrantedAccess;
- USHORT GrantedAccessIndex;
+ struct
+ {
+ USHORT GrantedAccessIndex;
+ USHORT CreatorBackTraceIndex;
+ };
LONG NextFreeTableEntry;
- } u2;
+ };
} HANDLE_TABLE_ENTRY, *PHANDLE_TABLE_ENTRY;
typedef struct _HANDLE_TABLE
{
- ULONG Flags;
- LONG HandleCount;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+ ULONG TableCode;
+#else
PHANDLE_TABLE_ENTRY **Table;
+#endif
PEPROCESS QuotaProcess;
- HANDLE UniqueProcessId;
- LONG FirstFreeTableEntry;
- LONG NextIndexNeedingPool;
- ERESOURCE HandleTableLock;
+ PVOID UniqueProcessId;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+ EX_PUSH_LOCK HandleLock;
+ LIST_ENTRY HandleTableList;
+ EX_PUSH_LOCK HandleContentionEvent;
+#else
+ ERESOURCE HandleLock;
LIST_ENTRY HandleTableList;
KEVENT HandleContentionEvent;
+#endif
+ PHANDLE_TRACE_DEBUG_INFO DebugInfo;
+ LONG ExtraInfoPages;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+ union
+ {
+ ULONG Flags;
+ UCHAR StrictFIFO:1;
+ };
+ LONG FirstFreeHandle;
+ PHANDLE_TABLE_ENTRY LastFreeHandleEntry;
+ LONG HandleCount;
+ ULONG NextHandleNeedingPool;
+#else
+ ULONG FirstFree;
+ ULONG LastFree;
+ ULONG NextHandleNeedingPool;
+ LONG HandleCount;
+ union
+ {
+ ULONG Flags;
+ UCHAR StrictFIFO:1;
+ };
+#endif
} HANDLE_TABLE, *PHANDLE_TABLE;
#endif
Modified: trunk/reactos/ntoskrnl/ex/handle.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=21…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/handle.c (original)
+++ trunk/reactos/ntoskrnl/ex/handle.c Fri May 19 04:32:50 2006
@@ -33,14 +33,14 @@
#define ExReleaseHandleTableListLock() \
ExReleaseFastMutexUnsafe(&ExpHandleTableListLock)
-#define ExAcquireHandleTableLockExclusive(HandleTable) \
- ExAcquireResourceExclusiveLite(&(HandleTable)->HandleTableLock, TRUE)
-
-#define ExAcquireHandleTableLockShared(HandleTable) \
- ExAcquireResourceSharedLite(&(HandleTable)->HandleTableLock, TRUE)
-
-#define ExReleaseHandleTableLock(HandleTable) \
- ExReleaseResourceLite(&(HandleTable)->HandleTableLock)
+#define ExAcquireHandleLockExclusive(HandleTable) \
+ ExAcquireResourceExclusiveLite(&(HandleTable)->HandleLock, TRUE)
+
+#define ExAcquireHandleLockShared(HandleTable) \
+ ExAcquireResourceSharedLite(&(HandleTable)->HandleLock, TRUE)
+
+#define ExReleaseHandleLock(HandleTable) \
+ ExReleaseResourceLite(&(HandleTable)->HandleLock)
/*
5 bits: reserved
@@ -123,11 +123,11 @@
HandleTable->HandleCount = 0;
HandleTable->Table = (PHANDLE_TABLE_ENTRY**)(HandleTable + 1);
HandleTable->QuotaProcess = QuotaProcess;
- HandleTable->FirstFreeTableEntry = -1; /* no entries freed so far */
- HandleTable->NextIndexNeedingPool = 0; /* no entries freed so far, so we have to
allocate already for the first handle */
+ HandleTable->FirstFree = -1; /* no entries freed so far */
+ HandleTable->NextHandleNeedingPool = 0; /* no entries freed so far, so we have to
allocate already for the first handle */
HandleTable->UniqueProcessId = (QuotaProcess ? QuotaProcess->UniqueProcessId :
NULL);
- ExInitializeResource(&HandleTable->HandleTableLock);
+ ExInitializeResource(&HandleTable->HandleLock);
KeInitializeEvent(&HandleTable->HandleContentionEvent,
NotificationEvent,
@@ -176,7 +176,7 @@
KeEnterCriticalRegion();
/* ensure there's no other operations going by acquiring an exclusive lock */
- ExAcquireHandleTableLockExclusive(HandleTable);
+ ExAcquireHandleLockExclusive(HandleTable);
ASSERT(!(HandleTable->Flags & EX_HANDLE_TABLE_CLOSING));
@@ -206,10 +206,10 @@
curee != laste;
curee++)
{
- if(curee->u1.Object != NULL && SweepHandleCallback != NULL)
+ if(curee->Object != NULL && SweepHandleCallback != NULL)
{
- curee->u1.ObAttributes |= EX_HANDLE_ENTRY_LOCKED;
- SweepHandleCallback(HandleTable, curee->u1.Object,
curee->u2.GrantedAccess, Context);
+ curee->ObAttributes |= EX_HANDLE_ENTRY_LOCKED;
+ SweepHandleCallback(HandleTable, curee->Object, curee->GrantedAccess,
Context);
}
}
}
@@ -217,7 +217,7 @@
}
}
- ExReleaseHandleTableLock(HandleTable);
+ ExReleaseHandleLock(HandleTable);
KeLeaveCriticalRegion();
}
@@ -281,7 +281,7 @@
KeLeaveCriticalRegion();
/* free the handle table */
- ExDeleteResource(&HandleTable->HandleTableLock);
+ ExDeleteResource(&HandleTable->HandleLock);
ExFreePool(HandleTable);
if(QuotaProcess != NULL)
@@ -311,7 +311,7 @@
tli = mli = eli = 0;
/* make sure the other handle table isn't being changed during the duplication
*/
- ExAcquireHandleTableLockShared(SourceHandleTable);
+ ExAcquireHandleLockShared(SourceHandleTable);
/* allocate enough tables */
etlp = SourceHandleTable->Table + N_TOPLEVEL_POINTERS;
@@ -372,7 +372,7 @@
freehandletable:
DPRINT1("Failed to duplicate handle table 0x%p\n",
SourceHandleTable);
- ExReleaseHandleTableLock(SourceHandleTable);
+ ExReleaseHandleLock(SourceHandleTable);
ExDestroyHandleTable(HandleTable);
/* allocate an empty handle table */
@@ -383,8 +383,8 @@
/* duplicate the handles */
HandleTable->HandleCount = SourceHandleTable->HandleCount;
- HandleTable->FirstFreeTableEntry = SourceHandleTable->FirstFreeTableEntry;
- HandleTable->NextIndexNeedingPool = SourceHandleTable->NextIndexNeedingPool;
+ HandleTable->FirstFree = SourceHandleTable->FirstFree;
+ HandleTable->NextHandleNeedingPool = SourceHandleTable->NextHandleNeedingPool;
/* make sure all tables are zeroed */
KeMemoryBarrier();
@@ -414,7 +414,7 @@
srcstbl++, stbl++, eli++)
{
/* try to duplicate the source handle */
- if(srcstbl->u1.Object != NULL &&
+ if(srcstbl->Object != NULL &&
ExLockHandleTableEntry(SourceHandleTable,
srcstbl))
{
@@ -426,15 +426,15 @@
{
/* free the entry and chain it into the free list */
HandleTable->HandleCount--;
- stbl->u1.Object = NULL;
- stbl->u2.NextFreeTableEntry = HandleTable->FirstFreeTableEntry;
- HandleTable->FirstFreeTableEntry = BUILD_HANDLE(tli, mli, eli);
+ stbl->Object = NULL;
+ stbl->NextFreeTableEntry = HandleTable->FirstFree;
+ HandleTable->FirstFree = BUILD_HANDLE(tli, mli, eli);
}
else
{
/* duplicate the handle and unlock it */
- stbl->u2.GrantedAccess = srcstbl->u2.GrantedAccess;
- stbl->u1.ObAttributes = srcstbl->u1.ObAttributes &
~EX_HANDLE_ENTRY_LOCKED;
+ stbl->GrantedAccess = srcstbl->GrantedAccess;
+ stbl->ObAttributes = srcstbl->ObAttributes &
~EX_HANDLE_ENTRY_LOCKED;
}
ExUnlockHandleTableEntry(SourceHandleTable,
srcstbl);
@@ -452,7 +452,7 @@
}
/* release the source handle table */
- ExReleaseHandleTableLock(SourceHandleTable);
+ ExReleaseHandleLock(SourceHandleTable);
}
return HandleTable;
@@ -476,12 +476,12 @@
{
ULONG tli, mli, eli;
- if(HandleTable->FirstFreeTableEntry != -1)
+ if(HandleTable->FirstFree != -1)
{
/* there's a free handle entry we can just grab and use */
- tli = TLI_FROM_HANDLE(HandleTable->FirstFreeTableEntry);
- mli = MLI_FROM_HANDLE(HandleTable->FirstFreeTableEntry);
- eli = ELI_FROM_HANDLE(HandleTable->FirstFreeTableEntry);
+ tli = TLI_FROM_HANDLE(HandleTable->FirstFree);
+ mli = MLI_FROM_HANDLE(HandleTable->FirstFree);
+ eli = ELI_FROM_HANDLE(HandleTable->FirstFree);
/* the pointer should be valid in any way!!! */
ASSERT(HandleTable->Table[tli]);
@@ -489,12 +489,12 @@
Entry = &HandleTable->Table[tli][mli][eli];
- *Handle = EX_HANDLE_TO_HANDLE(HandleTable->FirstFreeTableEntry);
+ *Handle = EX_HANDLE_TO_HANDLE(HandleTable->FirstFree);
/* save the index to the next free handle (if available) */
- HandleTable->FirstFreeTableEntry = Entry->u2.NextFreeTableEntry;
- Entry->u2.NextFreeTableEntry = 0;
- Entry->u1.Object = NULL;
+ HandleTable->FirstFree = Entry->NextFreeTableEntry;
+ Entry->NextFreeTableEntry = 0;
+ Entry->Object = NULL;
HandleTable->HandleCount++;
}
@@ -505,18 +505,18 @@
ULONG i;
BOOLEAN AllocatedMtbl;
- ASSERT(HandleTable->NextIndexNeedingPool <= N_MAX_HANDLE);
+ ASSERT(HandleTable->NextHandleNeedingPool <= N_MAX_HANDLE);
/* the index of the next table to be allocated was saved in
- NextIndexNeedingPool the last time a handle entry was allocated and
+ NextHandleNeedingPool the last time a handle entry was allocated and
the subhandle entry list was full. the subhandle entry index of
- NextIndexNeedingPool should be 0 here! */
- tli = TLI_FROM_HANDLE(HandleTable->NextIndexNeedingPool);
- mli = MLI_FROM_HANDLE(HandleTable->NextIndexNeedingPool);
- DPRINT("HandleTable->NextIndexNeedingPool: 0x%x\n",
HandleTable->NextIndexNeedingPool);
- DPRINT("tli: 0x%x mli: 0x%x eli: 0x%x\n", tli, mli,
ELI_FROM_HANDLE(HandleTable->NextIndexNeedingPool));
-
- ASSERT(ELI_FROM_HANDLE(HandleTable->NextIndexNeedingPool) == 0);
+ NextHandleNeedingPool should be 0 here! */
+ tli = TLI_FROM_HANDLE(HandleTable->NextHandleNeedingPool);
+ mli = MLI_FROM_HANDLE(HandleTable->NextHandleNeedingPool);
+ DPRINT("HandleTable->NextHandleNeedingPool: 0x%x\n",
HandleTable->NextHandleNeedingPool);
+ DPRINT("tli: 0x%x mli: 0x%x eli: 0x%x\n", tli, mli,
ELI_FROM_HANDLE(HandleTable->NextHandleNeedingPool));
+
+ ASSERT(ELI_FROM_HANDLE(HandleTable->NextHandleNeedingPool) == 0);
DPRINT("HandleTable->Table[%d] == 0x%p\n", tli,
HandleTable->Table[tli]);
@@ -595,25 +595,25 @@
/* let's just use the very first entry */
Entry = ntbl;
- Entry->u1.ObAttributes = EX_HANDLE_ENTRY_LOCKED;
- Entry->u2.NextFreeTableEntry = 0;
-
- *Handle = EX_HANDLE_TO_HANDLE(HandleTable->NextIndexNeedingPool);
+ Entry->ObAttributes = EX_HANDLE_ENTRY_LOCKED;
+ Entry->NextFreeTableEntry = 0;
+
+ *Handle = EX_HANDLE_TO_HANDLE(HandleTable->NextHandleNeedingPool);
HandleTable->HandleCount++;
- /* set the FirstFreeTableEntry member to the second entry and chain the
+ /* set the FirstFree member to the second entry and chain the
free entries */
- HandleTable->FirstFreeTableEntry = HandleTable->NextIndexNeedingPool + 1;
- for(cure = Entry + 1, laste = Entry + N_SUBHANDLE_ENTRIES, i =
HandleTable->FirstFreeTableEntry + 1;
+ HandleTable->FirstFree = HandleTable->NextHandleNeedingPool + 1;
+ for(cure = Entry + 1, laste = Entry + N_SUBHANDLE_ENTRIES, i =
HandleTable->FirstFree + 1;
cure != laste;
cure++, i++)
{
- cure->u1.Object = NULL;
- cure->u2.NextFreeTableEntry = i;
+ cure->Object = NULL;
+ cure->NextFreeTableEntry = i;
}
/* truncate the free entry list */
- (cure - 1)->u2.NextFreeTableEntry = -1;
+ (cure - 1)->NextFreeTableEntry = -1;
/* save the pointers to the allocated list(s) */
(void)InterlockedExchangePointer(&nmtbl[mli], ntbl);
@@ -622,9 +622,9 @@
(void)InterlockedExchangePointer(&HandleTable->Table[tli], nmtbl);
}
- /* increment the NextIndexNeedingPool to the next index where we need to
+ /* increment the NextHandleNeedingPool to the next index where we need to
allocate new memory */
- HandleTable->NextIndexNeedingPool += N_SUBHANDLE_ENTRIES;
+ HandleTable->NextHandleNeedingPool += N_SUBHANDLE_ENTRIES;
}
}
else
@@ -651,9 +651,9 @@
/* automatically unlock the entry if currently locked. We however don't notify
anyone who waited on the handle because we're holding an exclusive lock after
all and these locks will fail then */
- (void)InterlockedExchangePointer(&Entry->u1.Object, NULL);
- Entry->u2.NextFreeTableEntry = HandleTable->FirstFreeTableEntry;
- HandleTable->FirstFreeTableEntry = Handle;
+ (void)InterlockedExchangePointer(&Entry->Object, NULL);
+ Entry->NextFreeTableEntry = HandleTable->FirstFree;
+ HandleTable->FirstFree = Handle;
HandleTable->HandleCount--;
}
@@ -678,11 +678,11 @@
eli = ELI_FROM_HANDLE(Handle);
mlp = HandleTable->Table[tli];
- if(Handle < HandleTable->NextIndexNeedingPool &&
- mlp != NULL && mlp[mli] != NULL && mlp[mli][eli].u1.Object !=
NULL)
+ if(Handle < HandleTable->NextHandleNeedingPool &&
+ mlp != NULL && mlp[mli] != NULL && mlp[mli][eli].Object != NULL)
{
Entry = &mlp[mli][eli];
- DPRINT("handle lookup 0x%x -> entry 0x%p [HT:0x%p] ptr: 0x%p\n",
Handle, Entry, HandleTable, mlp[mli][eli].u1.Object);
+ DPRINT("handle lookup 0x%x -> entry 0x%p [HT:0x%p] ptr: 0x%p\n",
Handle, Entry, HandleTable, mlp[mli][eli].Object);
}
}
else
@@ -708,7 +708,7 @@
for(;;)
{
- Current = (volatile ULONG_PTR)Entry->u1.Object;
+ Current = (volatile ULONG_PTR)Entry->Object;
if(!Current || (HandleTable->Flags & EX_HANDLE_TABLE_CLOSING))
{
@@ -719,7 +719,7 @@
if(!(Current & EX_HANDLE_ENTRY_LOCKED))
{
New = Current | EX_HANDLE_ENTRY_LOCKED;
- if(InterlockedCompareExchangePointer(&Entry->u1.Object,
+ if(InterlockedCompareExchangePointer(&Entry->Object,
(PVOID)New,
(PVOID)Current) == (PVOID)Current)
{
@@ -756,13 +756,13 @@
DPRINT("ExUnlockHandleTableEntry HT:0x%p Entry:0x%p\n", HandleTable, Entry);
- Current = (volatile ULONG_PTR)Entry->u1.Object;
+ Current = (volatile ULONG_PTR)Entry->Object;
ASSERT(Current & EX_HANDLE_ENTRY_LOCKED);
New = Current & ~EX_HANDLE_ENTRY_LOCKED;
- (void)InterlockedExchangePointer(&Entry->u1.Object,
+ (void)InterlockedExchangePointer(&Entry->Object,
(PVOID)New);
/* we unlocked the entry, pulse the contention event so threads who're waiting
@@ -784,13 +784,13 @@
ASSERT(HandleTable);
ASSERT(Entry);
- /* The highest bit in Entry->u1.Object has to be 1 so we make sure it's a
+ /* The highest bit in Entry->Object has to be 1 so we make sure it's a
pointer to kmode memory. It will cleared though because it also indicates
the lock */
- ASSERT((ULONG_PTR)Entry->u1.Object & EX_HANDLE_ENTRY_LOCKED);
+ ASSERT((ULONG_PTR)Entry->Object & EX_HANDLE_ENTRY_LOCKED);
KeEnterCriticalRegion();
- ExAcquireHandleTableLockExclusive(HandleTable);
+ ExAcquireHandleLockExclusive(HandleTable);
NewHandleTableEntry = ExpAllocateHandleTableEntry(HandleTable,
&Handle);
@@ -802,7 +802,7 @@
NewHandleTableEntry);
}
- ExReleaseHandleTableLock(HandleTable);
+ ExReleaseHandleLock(HandleTable);
KeLeaveCriticalRegion();
return Handle;
@@ -823,7 +823,7 @@
ExHandle = HANDLE_TO_EX_HANDLE(Handle);
KeEnterCriticalRegion();
- ExAcquireHandleTableLockExclusive(HandleTable);
+ ExAcquireHandleLockExclusive(HandleTable);
HandleTableEntry = ExpLookupHandleTableEntry(HandleTable,
ExHandle);
@@ -838,7 +838,7 @@
Ret = TRUE;
}
- ExReleaseHandleTableLock(HandleTable);
+ ExReleaseHandleLock(HandleTable);
KeLeaveCriticalRegion();
return Ret;
@@ -855,12 +855,12 @@
ASSERT(Entry);
/* This routine requires the entry to be locked */
- ASSERT((ULONG_PTR)Entry->u1.Object & EX_HANDLE_ENTRY_LOCKED);
+ ASSERT((ULONG_PTR)Entry->Object & EX_HANDLE_ENTRY_LOCKED);
DPRINT("DestroyHandleByEntry HT:0x%p Entry:0x%p\n", HandleTable, Entry);
KeEnterCriticalRegion();
- ExAcquireHandleTableLockExclusive(HandleTable);
+ ExAcquireHandleLockExclusive(HandleTable);
/* free and automatically unlock the handle. However we don't need to pulse
the contention event since other locks on this entry will fail */
@@ -868,7 +868,7 @@
Entry,
HANDLE_TO_EX_HANDLE(Handle));
- ExReleaseHandleTableLock(HandleTable);
+ ExReleaseHandleLock(HandleTable);
KeLeaveCriticalRegion();
}
Modified: trunk/reactos/ntoskrnl/include/internal/ex.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/include/internal/e…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ex.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ex.h Fri May 19 04:32:50 2006
@@ -11,7 +11,7 @@
#define EX_OBJ_TO_HDR(eob) ((PROS_OBJECT_HEADER)((ULONG_PTR)(eob) & \
~(EX_HANDLE_ENTRY_PROTECTFROMCLOSE | EX_HANDLE_ENTRY_INHERITABLE | \
EX_HANDLE_ENTRY_AUDITONCLOSE)))
-#define EX_HTE_TO_HDR(hte) ((PROS_OBJECT_HEADER)((ULONG_PTR)((hte)->u1.Object) &
\
+#define EX_HTE_TO_HDR(hte) ((PROS_OBJECT_HEADER)((ULONG_PTR)((hte)->Object) & \
~(EX_HANDLE_ENTRY_PROTECTFROMCLOSE | EX_HANDLE_ENTRY_INHERITABLE | \
EX_HANDLE_ENTRY_AUDITONCLOSE)))
Modified: trunk/reactos/ntoskrnl/ob/handle.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ob/handle.c?rev=21…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/handle.c (original)
+++ trunk/reactos/ntoskrnl/ob/handle.c Fri May 19 04:32:50 2006
@@ -123,8 +123,8 @@
Handle);
if (HandleTableEntry != NULL)
{
- HandleInfo->Inherit = (HandleTableEntry->u1.ObAttributes &
EX_HANDLE_ENTRY_INHERITABLE) != 0;
- HandleInfo->ProtectFromClose = (HandleTableEntry->u1.ObAttributes &
EX_HANDLE_ENTRY_PROTECTFROMCLOSE) != 0;
+ HandleInfo->Inherit = (HandleTableEntry->ObAttributes &
EX_HANDLE_ENTRY_INHERITABLE) != 0;
+ HandleInfo->ProtectFromClose = (HandleTableEntry->ObAttributes &
EX_HANDLE_ENTRY_PROTECTFROMCLOSE) != 0;
ExUnlockHandleTableEntry(Process->ObjectTable,
HandleTableEntry);
@@ -183,14 +183,14 @@
if (HandleTableEntry != NULL)
{
if (HandleInfo->Inherit)
- HandleTableEntry->u1.ObAttributes |= EX_HANDLE_ENTRY_INHERITABLE;
+ HandleTableEntry->ObAttributes |= EX_HANDLE_ENTRY_INHERITABLE;
else
- HandleTableEntry->u1.ObAttributes &= ~EX_HANDLE_ENTRY_INHERITABLE;
+ HandleTableEntry->ObAttributes &= ~EX_HANDLE_ENTRY_INHERITABLE;
if (HandleInfo->ProtectFromClose)
- HandleTableEntry->u1.ObAttributes |= EX_HANDLE_ENTRY_PROTECTFROMCLOSE;
+ HandleTableEntry->ObAttributes |= EX_HANDLE_ENTRY_PROTECTFROMCLOSE;
else
- HandleTableEntry->u1.ObAttributes &= ~EX_HANDLE_ENTRY_PROTECTFROMCLOSE;
+ HandleTableEntry->ObAttributes &= ~EX_HANDLE_ENTRY_PROTECTFROMCLOSE;
/* FIXME: Do we need to set anything in the object header??? */
@@ -231,7 +231,7 @@
Handle);
if(HandleEntry != NULL)
{
- if(HandleEntry->u1.ObAttributes & EX_HANDLE_ENTRY_PROTECTFROMCLOSE)
+ if(HandleEntry->ObAttributes & EX_HANDLE_ENTRY_PROTECTFROMCLOSE)
{
ExUnlockHandleTableEntry(ObjectTable,
HandleEntry);
@@ -316,17 +316,17 @@
ObjectHeader = EX_HTE_TO_HDR(SourceHandleEntry);
ObjectBody = &ObjectHeader->Body;
- NewHandleEntry.u1.Object = SourceHandleEntry->u1.Object;
+ NewHandleEntry.Object = SourceHandleEntry->Object;
if(HandleAttributes & OBJ_INHERIT)
- NewHandleEntry.u1.ObAttributes |= EX_HANDLE_ENTRY_INHERITABLE;
+ NewHandleEntry.ObAttributes |= EX_HANDLE_ENTRY_INHERITABLE;
else
- NewHandleEntry.u1.ObAttributes &= ~EX_HANDLE_ENTRY_INHERITABLE;
- NewHandleEntry.u2.GrantedAccess = ((Options & DUPLICATE_SAME_ACCESS) ?
- SourceHandleEntry->u2.GrantedAccess :
+ NewHandleEntry.ObAttributes &= ~EX_HANDLE_ENTRY_INHERITABLE;
+ NewHandleEntry.GrantedAccess = ((Options & DUPLICATE_SAME_ACCESS) ?
+ SourceHandleEntry->GrantedAccess :
DesiredAccess);
if (Options & DUPLICATE_SAME_ACCESS)
{
- NewHandleEntry.u2.GrantedAccess = SourceHandleEntry->u2.GrantedAccess;
+ NewHandleEntry.GrantedAccess = SourceHandleEntry->GrantedAccess;
}
else
{
@@ -335,7 +335,7 @@
RtlMapGenericMask(&DesiredAccess,
&ObjectHeader->Type->TypeInfo.GenericMapping);
}
- NewHandleEntry.u2.GrantedAccess = DesiredAccess;
+ NewHandleEntry.GrantedAccess = DesiredAccess;
}
/* reference the object so it doesn't get deleted after releasing the lock
@@ -634,7 +634,7 @@
PAGED_CODE();
- Ret = (HandleTableEntry->u1.ObAttributes & EX_HANDLE_ENTRY_INHERITABLE) != 0;
+ Ret = (HandleTableEntry->ObAttributes & EX_HANDLE_ENTRY_INHERITABLE) != 0;
if(Ret)
{
ObjectHeader = EX_HTE_TO_HDR(HandleTableEntry);
@@ -739,12 +739,12 @@
&ObjectHeader->Type->TypeInfo.GenericMapping);
}
- NewEntry.u1.Object = ObjectHeader;
+ NewEntry.Object = ObjectHeader;
if(HandleAttributes & OBJ_INHERIT)
- NewEntry.u1.ObAttributes |= EX_HANDLE_ENTRY_INHERITABLE;
+ NewEntry.ObAttributes |= EX_HANDLE_ENTRY_INHERITABLE;
else
- NewEntry.u1.ObAttributes &= ~EX_HANDLE_ENTRY_INHERITABLE;
- NewEntry.u2.GrantedAccess = GrantedAccess;
+ NewEntry.ObAttributes &= ~EX_HANDLE_ENTRY_INHERITABLE;
+ NewEntry.GrantedAccess = GrantedAccess;
if ((HandleAttributes & OBJ_KERNEL_HANDLE) &&
ExGetPreviousMode == KernelMode)
@@ -834,7 +834,7 @@
Handle);
if(HandleEntry != NULL)
{
- *GenerateOnClose = (HandleEntry->u1.ObAttributes &
EX_HANDLE_ENTRY_AUDITONCLOSE) != 0;
+ *GenerateOnClose = (HandleEntry->ObAttributes & EX_HANDLE_ENTRY_AUDITONCLOSE)
!= 0;
ExUnlockHandleTableEntry(Process->ObjectTable,
HandleEntry);
@@ -1013,7 +1013,7 @@
&BODY_TO_HEADER(ObjectBody)->Type->TypeInfo.GenericMapping);
}
- GrantedAccess = HandleEntry->u2.GrantedAccess;
+ GrantedAccess = HandleEntry->GrantedAccess;
/* Unless running as KernelMode, deny access if caller desires more access
rights than the handle can grant */
@@ -1036,7 +1036,7 @@
ObReferenceObject(ObjectBody);
- Attributes = HandleEntry->u1.ObAttributes & (EX_HANDLE_ENTRY_PROTECTFROMCLOSE
|
+ Attributes = HandleEntry->ObAttributes & (EX_HANDLE_ENTRY_PROTECTFROMCLOSE |
EX_HANDLE_ENTRY_INHERITABLE |
EX_HANDLE_ENTRY_AUDITONCLOSE);
Modified: trunk/reactos/ntoskrnl/ob/wait.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ob/wait.c?rev=2194…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/wait.c (original)
+++ trunk/reactos/ntoskrnl/ob/wait.c Fri May 19 04:32:50 2006
@@ -132,7 +132,7 @@
}
/* Check for synchronize access */
- GrantedAccess = HandleEntry->u2.GrantedAccess;
+ GrantedAccess = HandleEntry->GrantedAccess;
if ((PreviousMode != KernelMode) && (!(GrantedAccess &
SYNCHRONIZE)))
{
/* Unlock the entry and fail */
Modified: trunk/reactos/ntoskrnl/ps/process.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/process.c (original)
+++ trunk/reactos/ntoskrnl/ps/process.c Fri May 19 04:32:50 2006
@@ -383,8 +383,8 @@
/* Create a handle for the Process */
DPRINT("Initialzing Process CID Handle\n");
- CidEntry.u1.Object = Process;
- CidEntry.u2.GrantedAccess = 0;
+ CidEntry.Object = Process;
+ CidEntry.GrantedAccess = 0;
Process->UniqueProcessId = ExCreateHandle(PspCidTable, &CidEntry);
DPRINT("Created CID: %d\n", Process->UniqueProcessId);
if(!Process->UniqueProcessId)
@@ -499,7 +499,7 @@
ProcessId)))
{
/* Get the Process */
- FoundProcess = CidEntry->u1.Object;
+ FoundProcess = CidEntry->Object;
/* Make sure it's really a process */
if (FoundProcess->Pcb.Header.Type == ProcessObject)
@@ -541,7 +541,7 @@
Cid->UniqueThread)))
{
/* Get the Process */
- FoundThread = CidEntry->u1.Object;
+ FoundThread = CidEntry->Object;
/* Make sure it's really a thread and this process' */
if ((FoundThread->Tcb.DispatcherHeader.Type == ThreadObject) &&
Modified: trunk/reactos/ntoskrnl/ps/psmgr.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/psmgr.c?rev=219…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/psmgr.c (original)
+++ trunk/reactos/ntoskrnl/ps/psmgr.c Fri May 19 04:32:50 2006
@@ -306,8 +306,8 @@
ObCreateHandleTable(NULL, FALSE, PsInitialSystemProcess);
ObpKernelHandleTable = PsInitialSystemProcess->ObjectTable;
- CidEntry.u1.Object = PsInitialSystemProcess;
- CidEntry.u2.GrantedAccess = 0;
+ CidEntry.Object = PsInitialSystemProcess;
+ CidEntry.GrantedAccess = 0;
PsInitialSystemProcess->UniqueProcessId = ExCreateHandle(PspCidTable,
&CidEntry);
if(!PsInitialSystemProcess->UniqueProcessId)
Modified: trunk/reactos/ntoskrnl/ps/thread.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/thread.c?rev=21…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/thread.c (original)
+++ trunk/reactos/ntoskrnl/ps/thread.c Fri May 19 04:32:50 2006
@@ -182,8 +182,8 @@
/* Create Cid Handle */
DPRINT("Creating Thread Handle (CID)\n");
- CidEntry.u1.Object = Thread;
- CidEntry.u2.GrantedAccess = 0;
+ CidEntry.Object = Thread;
+ CidEntry.GrantedAccess = 0;
Thread->Cid.UniqueThread = ExCreateHandle(PspCidTable, &CidEntry);
if (!Thread->Cid.UniqueThread) {
@@ -378,7 +378,7 @@
ThreadId)))
{
/* Get the Process */
- FoundThread = CidEntry->u1.Object;
+ FoundThread = CidEntry->Object;
/* Make sure it's really a process */
if (FoundThread->Tcb.DispatcherHeader.Type == ThreadObject)
Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/rtl/libsupp.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/rtl/libsupp.c (original)
+++ trunk/reactos/ntoskrnl/rtl/libsupp.c Fri May 19 04:32:50 2006
@@ -292,8 +292,8 @@
HANDLE Handle;
USHORT HandleIndex;
- ExEntry.u1.Object = Entry;
- ExEntry.u2.GrantedAccess = 0x1; /* FIXME - valid handle */
+ ExEntry.Object = Entry;
+ ExEntry.GrantedAccess = 0x1; /* FIXME - valid handle */
Handle = ExCreateHandle(AtomTable->ExHandleTable,
&ExEntry);
@@ -330,7 +330,7 @@
(HANDLE)((ULONG_PTR)Index << 2));
if (ExEntry != NULL)
{
- Entry = ExEntry->u1.Object;
+ Entry = ExEntry->Object;
ExUnlockHandleTableEntry(AtomTable->ExHandleTable,
ExEntry);