#ifndef _INCLUDE_DDK_IOFUNCS_H
#define _INCLUDE_DDK_IOFUNCS_H
-/* $Id: iofuncs.h,v 1.44 2004/10/09 18:16:57 navaraf Exp $ */
+/* $Id: iofuncs.h,v 1.45 2004/10/22 20:51:44 ekohl Exp $ */
#ifdef __NTOSKRNL__
extern POBJECT_TYPE EXPORTED IoAdapterObjectType;
IoAcquireVpbSpinLock (
PKIRQL Irpl
);
+
/**********************************************************************
* NAME EXPORTED
* IoAllocateAdapterChannel@
#define IoSetCompletionRoutine(Irp,Routine,NewContext,Success,Error,Cancel) \
{ \
PIO_STACK_LOCATION param; \
- assert((Success)||(Error)||(Cancel)?(Routine)!=NULL:TRUE); \
+ ASSERT((Success)||(Error)||(Cancel)?(Routine)!=NULL:TRUE); \
param = IoGetNextIrpStackLocation((Irp)); \
param->CompletionRoutine=(Routine); \
param->Context=(NewContext); \
);
NTSTATUS
-STDCALL /* TMN: Huh? BOTH explicit STDCALL, and implicit by NTAPI ??? */
-NTAPI
+STDCALL
IoGetDeviceInterfaces(
IN CONST GUID *InterfaceClassGuid,
IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
);
NTSTATUS
-STDCALL /* TMN: Huh? BOTH explicit STDCALL, and implicit by NTAPI ??? */
-NTAPI
+STDCALL
IoGetDeviceInterfaceAlias(
IN PUNICODE_STRING SymbolicLinkName,
IN CONST GUID *AliasInterfaceClassGuid,
#ifndef _INCLUDE_DDK_MMFUNCS_H
#define _INCLUDE_DDK_MMFUNCS_H
-/* $Id: mmfuncs.h,v 1.23 2004/07/17 03:04:45 ion Exp $ */
+/* $Id: mmfuncs.h,v 1.24 2004/10/22 20:51:44 ekohl Exp $ */
/* MEMORY MANAGMENT ******************************************************/
#define MmPrepareMdlForReuse(Mdl) \
if (((Mdl)->MdlFlags & MDL_PARTIAL_HAS_BEEN_MAPPED) != 0) \
{ \
- assert(((Mdl)->MdlFlags & MDL_PARTIAL) != 0); \
+ ASSERT(((Mdl)->MdlFlags & MDL_PARTIAL) != 0); \
MmUnmapLockedPages ((Mdl)->MappedSystemVa, (Mdl)); \
} \
else if (((Mdl)->MdlFlags & MDL_PARTIAL) == 0) \
{ \
- assert(((Mdl)->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA) == 0); \
+ ASSERT(((Mdl)->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA) == 0); \
}
/*
-/* $Id: rtl.h,v 1.34 2004/09/13 20:25:25 weiden Exp $
+/* $Id: rtl.h,v 1.35 2004/10/22 20:53:11 ekohl Exp $
*
*/
#ifndef __DDK_RTL_H
(ListEntry)->Blink = (ListHead); \
OldFlink->Blink = (ListEntry); \
(ListHead)->Flink = (ListEntry); \
- assert((ListEntry) != NULL); \
- assert((ListEntry)->Blink!=NULL); \
- assert((ListEntry)->Blink->Flink == (ListEntry)); \
- assert((ListEntry)->Flink != NULL); \
- assert((ListEntry)->Flink->Blink == (ListEntry)); \
+ ASSERT((ListEntry) != NULL); \
+ ASSERT((ListEntry)->Blink!=NULL); \
+ ASSERT((ListEntry)->Blink->Flink == (ListEntry)); \
+ ASSERT((ListEntry)->Flink != NULL); \
+ ASSERT((ListEntry)->Flink->Blink == (ListEntry)); \
}
{ \
PLIST_ENTRY OldFlink; \
PLIST_ENTRY OldBlink; \
- assert((ListEntry) != NULL); \
- assert((ListEntry)->Blink!=NULL); \
- assert((ListEntry)->Blink->Flink == (ListEntry)); \
- assert((ListEntry)->Flink != NULL); \
- assert((ListEntry)->Flink->Blink == (ListEntry)); \
+ ASSERT((ListEntry) != NULL); \
+ ASSERT((ListEntry)->Blink!=NULL); \
+ ASSERT((ListEntry)->Blink->Flink == (ListEntry)); \
+ ASSERT((ListEntry)->Flink != NULL); \
+ ASSERT((ListEntry)->Flink->Blink == (ListEntry)); \
OldFlink = (ListEntry)->Flink; \
OldBlink = (ListEntry)->Blink; \
OldFlink->Blink = OldBlink; \
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: handle.c,v 1.62 2004/09/28 15:02:29 weiden Exp $
+/* $Id: handle.c,v 1.63 2004/10/22 20:57:39 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
DPRINT("ObCreateHandle(Process %x, obj %x)\n",Process,ObjectBody);
- assert(Process);
+ ASSERT(Process);
if (ObjectBody != NULL)
{
}
-/*
- * @implemented
- */
-NTSTATUS STDCALL
-ObReferenceObjectByHandle(HANDLE Handle,
- ACCESS_MASK DesiredAccess,
- POBJECT_TYPE ObjectType,
- KPROCESSOR_MODE AccessMode,
- PVOID* Object,
- POBJECT_HANDLE_INFORMATION HandleInformation)
/*
* FUNCTION: Increments the reference count for an object and returns a
* pointer to its body
* HandleInformation (OUT) = Contains information about the handle
* on return
* RETURNS: Status
+ *
+ * @implemented
*/
+NTSTATUS STDCALL
+ObReferenceObjectByHandle(HANDLE Handle,
+ ACCESS_MASK DesiredAccess,
+ POBJECT_TYPE ObjectType,
+ KPROCESSOR_MODE AccessMode,
+ PVOID* Object,
+ POBJECT_HANDLE_INFORMATION HandleInformation)
{
PHANDLE_ENTRY HandleEntry;
POBJECT_HEADER ObjectHeader;
-/* $Id: create.c,v 1.82 2004/10/01 20:26:05 gvg Exp $
+/* $Id: create.c,v 1.83 2004/10/22 20:45:46 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
{
/* We'll be allocating a 64k block here and only use 4k of it, but this
path should almost never be taken. Actually, I never saw it was taken,
- so maybe we should just assert(NULL != Thread->ThreadsProcess) and
+ so maybe we should just ASSERT(NULL != Thread->ThreadsProcess) and
move on */
TebBase = NULL;
Status = ZwAllocateVirtualMemory(ProcessHandle,
}
DPRINT ("TebBase %p TebSize %lu\n", TebBase, TebSize);
- assert(NULL != TebBase && PAGE_SIZE <= TebSize);
+ ASSERT(NULL != TebBase && PAGE_SIZE <= TebSize);
RtlZeroMemory(&Teb, sizeof(TEB));
/* set all pointers to and from the TEB */
STDCALL
PsGetJobLock(PEJOB Job)
{
- assert(Job);
+ ASSERT(Job);
return (PVOID)&Job->JobLock;
}
STDCALL
PsGetJobSessionId(PEJOB Job)
{
- assert(Job);
+ ASSERT(Job);
return (PVOID)Job->SessionId;
}
STDCALL
PsGetJobUIRestrictionsClass(PEJOB Job)
{
- assert(Job);
+ ASSERT(Job);
return Job->UIRestrictionsClass;
}
/*
* @unimplemented
- */
+ */
VOID
STDCALL
PsSetJobUIRestrictionsClass(PEJOB Job,
ULONG UIRestrictionsClass)
{
- assert(Job);
+ ASSERT(Job);
InterlockedExchange((LONG*)&Job->UIRestrictionsClass, (LONG)UIRestrictionsClass);
/* FIXME - walk through the job process list and update the restrictions? */
}
-/* $Id: process.c,v 1.144 2004/10/01 20:26:05 gvg Exp $
+/* $Id: process.c,v 1.145 2004/10/22 20:45:46 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
DPRINT1("NtAllocateVirtualMemory() failed (Status %lx)\n", Status);
return(Status);
}
- assert((ULONG_PTR) Process->TebBlock <= PEB_BASE &&
+ ASSERT((ULONG_PTR) Process->TebBlock <= PEB_BASE &&
PEB_BASE + PAGE_SIZE <= (ULONG_PTR) Process->TebBlock + AllocSize);
Peb = (PPEB)PEB_BASE;
PebSize = PAGE_SIZE;
return(Status);
}
DPRINT("Peb %p PebSize %lu\n", Peb, PebSize);
- assert((PPEB) PEB_BASE == Peb && PAGE_SIZE <= PebSize);
+ ASSERT((PPEB) PEB_BASE == Peb && PAGE_SIZE <= PebSize);
Process->TebLastAllocated = (PVOID) Peb;
ViewSize = 0;
-#if defined(__GNUC__)
- SectionOffset.QuadPart = 0LL;
-#else
- SectionOffset.QuadPart = 0;
-#endif
+ SectionOffset.QuadPart = (ULONGLONG)0;
TableBase = NULL;
Status = MmMapViewOfSection(NlsSectionObject,
Process,
-/* $Id: thread.c,v 1.136 2004/10/17 15:39:29 hbirr Exp $
+/* $Id: thread.c,v 1.137 2004/10/22 20:45:46 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
static VOID
PsInsertIntoThreadList(KPRIORITY Priority, PETHREAD Thread)
{
- assert(THREAD_STATE_READY == Thread->Tcb.State);
+ ASSERT(THREAD_STATE_READY == Thread->Tcb.State);
if (Priority >= MAXIMUM_PRIORITY || Priority < LOW_PRIORITY)
{
DPRINT1("Invalid thread priority (%d)\n", Priority);
static VOID PsRemoveFromThreadList(PETHREAD Thread)
{
- assert(THREAD_STATE_READY == Thread->Tcb.State);
+ ASSERT(THREAD_STATE_READY == Thread->Tcb.State);
RemoveEntryList(&Thread->Tcb.QueueListEntry);
if (IsListEmpty(&PriorityListHead[(ULONG)Thread->Tcb.Priority]))
{
{
DPRINT1("%d/%d\n", current->Cid.UniqueThread, current->Tcb.State);
}
- assert(current->Tcb.State == THREAD_STATE_READY);
+ ASSERT(current->Tcb.State == THREAD_STATE_READY);
DPRINT("current->Tcb.UserAffinity %x Affinity %x PID %d %d\n",
current->Tcb.UserAffinity, Affinity, current->Cid.UniqueThread,
Priority);
-/* $Id: w32call.c,v 1.15 2004/08/27 10:25:46 hbirr Exp $
+/* $Id: w32call.c,v 1.16 2004/10/22 20:45:46 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
PFN_TYPE Page, SWAPENTRY SwapEntry,
BOOLEAN Dirty)
{
- assert(SwapEntry == 0);
+ ASSERT(SwapEntry == 0);
if (Page != 0)
{
MmReleasePageMemoryConsumer(MC_NPPOOL, Page);
-/* $Id: semgr.c,v 1.47 2004/10/01 01:28:56 arty Exp $
+/* $Id: semgr.c,v 1.48 2004/10/22 20:48:00 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
*NewDescriptor = Descriptor;
DPRINT("Descrptor %x\n", Descriptor);
- assert( RtlLengthSecurityDescriptor( Descriptor ) );
+ ASSERT(RtlLengthSecurityDescriptor(Descriptor));
return STATUS_SUCCESS;
}
-/* $Id: token.c,v 1.41 2004/08/10 21:11:20 gvg Exp $
+/* $Id: token.c,v 1.42 2004/10/22 20:48:00 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
TOKEN_EXECUTE,
TOKEN_ALL_ACCESS};
-#define SYSTEM_LUID 0x3E7;
+//#define SYSTEM_LUID 0x3E7;
/* FUNCTIONS *****************************************************************/
&TokenType,
&b,
&ImpersonationLevel);
- if (TokenType != 2)
+ if (TokenType != TokenImpersonation)
{
ClientContext->DirectAccessEffectiveOnly = Qos->EffectiveOnly;
}
}
return(STATUS_UNSUCCESSFUL);
}
- if (ImpersonationLevel == 0 ||
- ImpersonationLevel == 1 ||
- (RemoteClient != FALSE && ImpersonationLevel != 3))
+ if (ImpersonationLevel == SecurityAnonymous ||
+ ImpersonationLevel == SecurityIdentification ||
+ (RemoteClient != FALSE && ImpersonationLevel != SecurityDelegation))
{
if (Token != NULL)
{
return(Status);
}
- AccessToken->AuthenticationId.LowPart = SYSTEM_LUID;
- AccessToken->AuthenticationId.HighPart = 0;
+ Status = NtAllocateLocallyUniqueId(&AccessToken->AuthenticationId);
+ if (!NT_SUCCESS(Status))
+ {
+ ObDereferenceObject(AccessToken);
+ return Status;
+ }
AccessToken->TokenType = TokenPrimary;
AccessToken->ImpersonationLevel = SecurityDelegation;
AccessToken->Privileges[i++].Luid = SeManageVolumePrivilege;
#endif
- assert( i == 20 );
+ ASSERT(i == 20);
uSize = sizeof(ACL);
uSize += sizeof(ACE) + uLocalSystemLength;