- Fix dozens of missing typecast errors.

- Other MSVC/WDK compatibility fixes.

svn path=/trunk/; revision=24657
This commit is contained in:
Alex Ionescu 2006-10-26 01:49:51 +00:00
parent 3dbb7d20de
commit 6d56cb39a6
31 changed files with 106 additions and 73 deletions

View file

@ -93,6 +93,15 @@ ExfUnblockPushLock(
PVOID CurrentWaitBlock
);
//
// Resource Functions
//
BOOLEAN
NTAPI
ExTryToAcquireResourceExclusiveLite(
IN PERESOURCE Resource
);
#endif
//

View file

@ -104,6 +104,13 @@ extern ULONG NtBuildNumber;
#define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
SYNCHRONIZE | \
MUTANT_QUERY_STATE)
#define TIMER_QUERY_STATE 0x0001
#define TIMER_MODIFY_STATE 0x0002
#define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
SYNCHRONIZE | \
TIMER_QUERY_STATE | \
TIMER_MODIFY_STATE)
#endif
//

View file

@ -31,8 +31,10 @@ Author:
// The DDK steals these away from you.
//
#ifdef _MSC_VER
//#pragma intrinsic(_enable)
//#pragma intrinsic(_disable)
void _enable(void);
void _disable(void);
#pragma intrinsic(_enable)
#pragma intrinsic(_disable)
#endif
//
@ -208,5 +210,12 @@ HalQueryRealTimeClock(
IN PTIME_FIELDS RtcTime
);
NTHALAPI
VOID
NTAPI
HalSetRealTimeClock(
IN PTIME_FIELDS RtcTime
);
#endif
#endif

View file

@ -671,7 +671,6 @@ ZwDeviceIoControlFile(
IN ULONG OutputBufferSize
);
#ifdef NTOS_MODE_USER
NTSYSAPI
NTSTATUS
NTAPI
@ -679,7 +678,6 @@ ZwFlushBuffersFile(
IN HANDLE FileHandle,
OUT PIO_STATUS_BLOCK IoStatusBlock
);
#endif
NTSYSAPI
NTSTATUS

View file

@ -29,6 +29,16 @@ Author:
//
// Object Functions
//
NTKERNELAPI
NTSTATUS
NTAPI
ObAssignSecurity(
IN PACCESS_STATE AccessState,
IN PSECURITY_DESCRIPTOR SecurityDescriptor,
IN PVOID Object,
IN POBJECT_TYPE Type
);
NTKERNELAPI
NTSTATUS
NTAPI

View file

@ -478,10 +478,10 @@ typedef DWORD FLONG;
#ifndef __NTDDK_H
#define MUTANT_QUERY_STATE 0x0001
#define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
#endif
#define TIMER_QUERY_STATE 0x0001
#define TIMER_MODIFY_STATE 0x0002
#define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
#endif
/*
* To prevent gcc compiler warnings, bracket these defines when initialising
* a SID_IDENTIFIER_AUTHORITY, eg.

View file

@ -358,7 +358,7 @@ CcRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed)
for (i = 0; i < current->Bcb->CacheSegmentSize / PAGE_SIZE; i++)
{
PFN_TYPE Page;
Page = MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT;
Page = (PFN_TYPE)(MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT);
Status = MmPageOutPhysicalAddress(Page);
if (!NT_SUCCESS(Status))
{

View file

@ -276,8 +276,8 @@ CmiObjectParse(IN PVOID ParsedObject,
Length = wcslen(StartPtr);
KeyName.Length = Length * sizeof(WCHAR);
KeyName.MaximumLength = KeyName.Length + sizeof(WCHAR);
KeyName.Length = (USHORT)Length * sizeof(WCHAR);
KeyName.MaximumLength = (USHORT)KeyName.Length + sizeof(WCHAR);
KeyName.Buffer = ExAllocatePool(NonPagedPool,
KeyName.MaximumLength);
RtlCopyMemory(KeyName.Buffer,
@ -751,7 +751,7 @@ CmiObjectQueryName (PVOID ObjectBody,
{
ObjectNameInfo->Name.Buffer = (PWCHAR)(ObjectNameInfo + 1);
ObjectNameInfo->Name.Length = 0;
ObjectNameInfo->Name.MaximumLength = Length - sizeof(OBJECT_NAME_INFORMATION);
ObjectNameInfo->Name.MaximumLength = (USHORT)Length - sizeof(OBJECT_NAME_INFORMATION);
}
@ -931,13 +931,13 @@ CmiGetLinkTarget(PEREGISTRY_HIVE RegistryHive,
if (TargetPath->Buffer == NULL && TargetPath->MaximumLength == 0)
{
TargetPath->Length = 0;
TargetPath->MaximumLength = ValueCell->DataSize + sizeof(WCHAR);
TargetPath->MaximumLength = (USHORT)ValueCell->DataSize + sizeof(WCHAR);
TargetPath->Buffer = ExAllocatePool(NonPagedPool,
TargetPath->MaximumLength);
}
TargetPath->Length = min(TargetPath->MaximumLength - sizeof(WCHAR),
(ULONG) ValueCell->DataSize);
TargetPath->Length = min((USHORT)TargetPath->MaximumLength - sizeof(WCHAR),
(USHORT)ValueCell->DataSize);
if (ValueCell->DataSize > 0)
{

View file

@ -512,7 +512,7 @@ KiInterruptDispatch3 (ULONG vector, PKIRQ_TRAPFRAME Trapframe)
DPRINT("PID: %d, TID: %d CS %04x/%04x\n",
((PETHREAD)CurrentThread)->ThreadsProcess->UniqueProcessId,
((PETHREAD)CurrentThread)->Cid.UniqueThread,
Trapframe->SegCs,
Trapframe->Cs,
CurrentThread->TrapFrame ? CurrentThread->TrapFrame->SegCs : 0);
if (CurrentThread->TrapFrame == NULL)
{

View file

@ -80,7 +80,7 @@ ExpGetCurrentUserUILanguage(IN PWSTR MuiName,
if (NT_SUCCESS(Status))
{
/* Return the language */
*LanguageId = Value;
*LanguageId = (USHORT)Value;
}
}
else

View file

@ -71,7 +71,7 @@ ExGetCurrentProcessorCpuUsage (
ScaledIdle = Prcb->IdleThread->KernelTime * 100;
TotalTime = Prcb->KernelTime + Prcb->UserTime;
if (TotalTime != 0)
*CpuUsage = 100 - (ScaledIdle / TotalTime);
*CpuUsage = (ULONG)(100 - (ScaledIdle / TotalTime));
else
*CpuUsage = 0;
}
@ -211,7 +211,9 @@ NtQuerySystemEnvironmentValue (IN PUNICODE_STRING VariableName,
/*
* Get the environment variable
*/
Result = HalGetEnvironmentVariable(AName.Buffer, ValueBufferLength, Value);
Result = HalGetEnvironmentVariable(AName.Buffer,
(USHORT)ValueBufferLength,
Value);
if(!Result)
{
RtlFreeAnsiString(&AName);

View file

@ -297,13 +297,13 @@ FsRtlDissectDbcs(IN ANSI_STRING Name,
}
/* Now we have the First Part */
FirstPart->Length = (i-FirstLoop);
FirstPart->Length = (USHORT)(i - FirstLoop);
FirstPart->MaximumLength = FirstPart->Length; /* +2?? */
FirstPart->Buffer = &Name.Buffer[FirstLoop];
/* Make the second part if something is still left */
if (i<Name.Length) {
RemainingPart->Length = (Name.Length - (i+1));
RemainingPart->Length = (USHORT)(Name.Length - (i+1));
RemainingPart->MaximumLength = RemainingPart->Length; /* +2?? */
RemainingPart->Buffer = &Name.Buffer[i+1];
}

View file

@ -42,8 +42,10 @@ RtlpInitializeResources(VOID)
ULONG i;
/* Allocate the Resource Buffer */
FsRtlpResources = FsRtlAllocatePool(NonPagedPool,
FSRTL_MAX_RESOURCES*sizeof(ERESOURCE));
FsRtlpResources = FsRtlAllocatePoolWithTag(NonPagedPool,
FSRTL_MAX_RESOURCES *
sizeof(ERESOURCE),
TAG('F', 's', 'R', 'e'));
/* Initialize the Resources */
for (i = 0; i < FSRTL_MAX_RESOURCES; i++)

View file

@ -593,7 +593,7 @@ IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
return STATUS_INSUFFICIENT_RESOURCES;
KeyName.Length = 0;
KeyName.MaximumLength = KeyNameLength;
KeyName.MaximumLength = (USHORT)KeyNameLength;
KeyName.Buffer = KeyNameBuffer;
/*
@ -619,7 +619,7 @@ IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
ExFreePool(KeyNameBuffer);
return Status;
}
KeyName.Length += DriverKeyLength - sizeof(UNICODE_NULL);
KeyName.Length += (USHORT)DriverKeyLength - sizeof(UNICODE_NULL);
}
else
{
@ -750,7 +750,7 @@ IopGetBusTypeGuidIndex(LPGUID BusTypeGuid)
sizeof(GUID));
/* The new entry is the index */
FoundIndex = IopBusTypeGuidList->GuidCount;
FoundIndex = (USHORT)IopBusTypeGuidList->GuidCount;
IopBusTypeGuidList->GuidCount++;
Quickie:
@ -928,7 +928,7 @@ IopInitiatePnpIrp(PDEVICE_OBJECT DeviceObject,
Irp->IoStatus.Information = 0;
IrpSp = IoGetNextIrpStackLocation(Irp);
IrpSp->MinorFunction = MinorFunction;
IrpSp->MinorFunction = (UCHAR)MinorFunction;
if (Stack)
{
@ -1618,14 +1618,14 @@ IopGetParentIdPrefix(PDEVICE_NODE DeviceNode,
Status = STATUS_UNSUCCESSFUL;
else
{
KeyValue.Length = KeyValue.MaximumLength = ParentIdPrefixInformation->DataLength;
KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength;
KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data;
}
goto cleanup;
}
if (Status != STATUS_OBJECT_NAME_NOT_FOUND)
{
KeyValue.Length = KeyValue.MaximumLength = ParentIdPrefixInformation->DataLength;
KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength;
KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data;
goto cleanup;
}
@ -2711,7 +2711,7 @@ IopEnumerateDetectedDevices(
IndexDevice++;
/* Open device key */
DeviceName.Length = DeviceName.MaximumLength = pDeviceInformation->NameLength;
DeviceName.Length = DeviceName.MaximumLength = (USHORT)pDeviceInformation->NameLength;
DeviceName.Buffer = pDeviceInformation->Name;
InitializeObjectAttributes(&ObjectAttributes, &DeviceName, OBJ_KERNEL_HANDLE, hDevicesKey, NULL);
Status = ZwOpenKey(
@ -2832,7 +2832,7 @@ IopEnumerateDetectedDevices(
goto cleanup;
}
IndexSubKey++;
DeviceName.Length = DeviceName.MaximumLength = pDeviceInformation->NameLength;
DeviceName.Length = DeviceName.MaximumLength = (USHORT)pDeviceInformation->NameLength;
DeviceName.Buffer = pDeviceInformation->Name;
Status = IopEnumerateDetectedDevices(
@ -2878,7 +2878,7 @@ IopEnumerateDetectedDevices(
else
{
/* Assign hardware id to this device */
ValueName.Length = ValueName.MaximumLength = pValueInformation->DataLength;
ValueName.Length = ValueName.MaximumLength = (USHORT)pValueInformation->DataLength;
ValueName.Buffer = (PWCHAR)pValueInformation->Data;
if (ValueName.Length >= sizeof(WCHAR) && ValueName.Buffer[ValueName.Length / sizeof(WCHAR) - 1] == UNICODE_NULL)
ValueName.Length -= sizeof(WCHAR);

View file

@ -438,21 +438,21 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
LdrInit1();
/* Set the NX Support policy */
SharedUserData->NXSupportPolicy = NXSupportPolicy;
SharedUserData->NXSupportPolicy = (UCHAR)NXSupportPolicy;
/* Set basic CPU Features that user mode can read */
SharedUserData->ProcessorFeatures[PF_MMX_INSTRUCTIONS_AVAILABLE] =
(KeFeatureBits & KF_MMX);
(KeFeatureBits & KF_MMX) ? TRUE: FALSE;
SharedUserData->ProcessorFeatures[PF_COMPARE_EXCHANGE_DOUBLE] =
(KeFeatureBits & KF_CMPXCHG8B);
(KeFeatureBits & KF_CMPXCHG8B) ? TRUE: FALSE;
SharedUserData->ProcessorFeatures[PF_XMMI_INSTRUCTIONS_AVAILABLE] =
((KeFeatureBits & KF_FXSR) && (KeFeatureBits & KF_XMMI));
((KeFeatureBits & KF_FXSR) && (KeFeatureBits & KF_XMMI)) ? TRUE: FALSE;
SharedUserData->ProcessorFeatures[PF_XMMI64_INSTRUCTIONS_AVAILABLE] =
((KeFeatureBits & KF_FXSR) && (KeFeatureBits & KF_XMMI64));
((KeFeatureBits & KF_FXSR) && (KeFeatureBits & KF_XMMI64)) ? TRUE: FALSE;
SharedUserData->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] =
(KeFeatureBits & KF_3DNOW);
(KeFeatureBits & KF_3DNOW) ? TRUE: FALSE;
SharedUserData->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] =
(KeFeatureBits & KF_RDTSC);
(KeFeatureBits & KF_RDTSC) ? TRUE: FALSE;
/* Set up the thread-related fields in the PRCB */
Prcb->CurrentThread = InitThread;
@ -514,7 +514,7 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt,
{
KDESCRIPTOR GdtDescriptor, IdtDescriptor;
KGDTENTRY TssSelector, PcrSelector;
ULONG Tr, Fs;
USHORT Tr, Fs;
/* Get GDT and IDT descriptors */
Ke386GetGlobalDescriptorTable(GdtDescriptor);
@ -666,7 +666,7 @@ AppCpuInit:
InitialThread,
(PVOID)InitialStack,
(PKPRCB)__readfsdword(KPCR_PRCB),
Cpu,
(CCHAR)Cpu,
KeLoaderBlock);
/* Set the priority of this thread to 0 */

View file

@ -94,8 +94,8 @@ Ke386CallBios(IN ULONG Int,
/* Save the old offset and base, and set the new ones */
OldOffset = Process->IopmOffset;
OldBase = Tss->IoMapBase;
Process->IopmOffset = IOPM_OFFSET;
Tss->IoMapBase = IOPM_OFFSET;
Process->IopmOffset = (USHORT)IOPM_OFFSET;
Tss->IoMapBase = (USHORT)IOPM_OFFSET;
/* Switch stacks and work the magic */
Ki386SetupAndExitToV86Mode(VdmTeb);

View file

@ -281,7 +281,7 @@ KiAdjustQuantumThread(IN PKTHREAD Thread)
* due to the current ""scheduler"" in ROS, it can't be done
* cleanly since it actualyl dispatches threads instead.
*/
Thread->Priority = Priority;
Thread->Priority = (SCHAR)Priority;
}
else
{
@ -310,7 +310,7 @@ KiSetPriorityThread(PKTHREAD Thread,
if (OldPriority != Priority)
{
/* Set it */
Thread->Priority = Priority;
Thread->Priority = (SCHAR)Priority;
/* Choose action based on thread's state */
if (Thread->State == Ready)
@ -383,7 +383,7 @@ KiSetAffinityThread(IN PKTHREAD Thread,
{
KAFFINITY OldAffinity;
ULONG ProcessorMask;
ULONG i;
CCHAR i;
PKPCR Pcr;
/* Make sure that the affinity is valid */

View file

@ -1145,7 +1145,7 @@ LdrPEGetOrLoadModule (
RtlCopyMemory(NameBuffer, Module->FullDllName.Buffer, PathLength);
RtlCopyMemory(NameBuffer + (PathLength / sizeof(WCHAR)), DriverName.Buffer, DriverName.Length);
NameString.Buffer = NameBuffer;
NameString.MaximumLength = NameString.Length = PathLength + DriverName.Length;
NameString.MaximumLength = NameString.Length = (USHORT)PathLength + DriverName.Length;
/* NULL-terminate */
NameString.MaximumLength += sizeof(WCHAR);

View file

@ -65,7 +65,7 @@ EiReplyOrRequestPort (IN PEPORT Port,
MessageReply->Message.ClientId.UniqueProcess = PsGetCurrentProcessId();
MessageReply->Message.ClientId.UniqueThread = PsGetCurrentThreadId();
MessageReply->Message.u2.s2.Type = MessageType;
MessageReply->Message.u2.s2.Type = (CSHORT)MessageType;
MessageReply->Message.MessageId = InterlockedIncrementUL(&LpcpNextMessageId);
KeAcquireSpinLock(&Port->Lock, &oldIrql);
@ -276,7 +276,7 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle,
CRequest = (PEPORT_CONNECT_REQUEST_MESSAGE)&Request->Message;
memcpy(&Header, &Request->Message, sizeof(PORT_MESSAGE));
Header.u1.s1.DataLength = CRequest->ConnectDataLength;
Header.u1.s1.DataLength = (CSHORT)CRequest->ConnectDataLength;
Header.u1.s1.TotalLength = Header.u1.s1.DataLength + sizeof(PORT_MESSAGE);
if (PreviousMode != KernelMode)

View file

@ -586,7 +586,7 @@ MmDumpToPagingFile(ULONG BugCode,
RetrievalPointers = PagingFileList[MmCoreDumpPageFile]->RetrievalPointers;
/* Dump the header. */
MdlMap[0] = MmGetPhysicalAddress(MmCoreDumpPageFrame).QuadPart >> PAGE_SHIFT;
MdlMap[0] = (ULONG)(MmGetPhysicalAddress(MmCoreDumpPageFrame).QuadPart >> PAGE_SHIFT);
#if defined(__GNUC__)
DiskOffset = MmGetOffsetPageFile(RetrievalPointers, (LARGE_INTEGER)0LL);

View file

@ -163,7 +163,7 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory,
/* Save the result */
Context->HashValue = HashValue;
Context->HashIndex = HashIndex;
Context->HashIndex = (USHORT)HashIndex;
/* Get the root entry and set it as our lookup bucket */
AllocatedEntry = &Directory->HashBuckets[HashIndex];

View file

@ -61,7 +61,7 @@ INIT_FUNCTION
NTAPI
ObInit2(VOID)
{
ULONG i;
CCHAR i;
PKPRCB Prcb;
PNPAGED_LOOKASIDE_LIST CurrentList = NULL;

View file

@ -332,8 +332,8 @@ ObpCaptureObjectName(IN OUT PUNICODE_STRING CapturedName,
}
/* Setup the string */
CapturedName->Length = StringLength;
CapturedName->MaximumLength = MaximumLength;
CapturedName->Length = (USHORT)StringLength;
CapturedName->MaximumLength = (USHORT)MaximumLength;
CapturedName->Buffer = StringBuffer;
/* Make sure we have a buffer */

View file

@ -13,10 +13,6 @@
#define NDEBUG
#include <internal/debug.h>
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, ObInitSymbolicLinkImplementation)
#endif
/* GLOBALS ******************************************************************/
POBJECT_TYPE ObSymbolicLinkType = NULL;
@ -165,8 +161,8 @@ ObpParseSymbolicLink(IN PVOID ParsedObject,
if (NewTargetPath != FullPath->Buffer) ExFreePool(FullPath->Buffer);
/* Update the path values */
FullPath->Length = LengthUsed;
FullPath->MaximumLength = MaximumLength;
FullPath->Length = (USHORT)LengthUsed;
FullPath->MaximumLength = (USHORT)MaximumLength;
FullPath->Buffer = NewTargetPath;
/* Tell the parse routine to start reparsing */
@ -247,7 +243,7 @@ NtCreateSymbolicLinkObject(OUT PHANDLE LinkHandle,
{
/* Round it down */
CapturedLinkTarget.MaximumLength =
ALIGN_DOWN(CapturedLinkTarget.MaximumLength, WCHAR);
(USHORT)ALIGN_DOWN(CapturedLinkTarget.MaximumLength, WCHAR);
}
/* Fail if the length is odd, or if the maximum is smaller or 0 */

View file

@ -658,9 +658,9 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
if (!NT_SUCCESS(Status)) goto Cleanup;
/* Compute Quantum and Priority */
Process->Pcb.BasePriority = PspComputeQuantumAndPriority(Process,
0,
&Quantum);
Process->Pcb.BasePriority = (SCHAR)PspComputeQuantumAndPriority(Process,
0,
&Quantum);
Process->Pcb.QuantumReset = Quantum;
/* Check if we have a parent other then the initial system process */
@ -912,7 +912,7 @@ BOOLEAN
NTAPI
PsGetProcessExitProcessCalled(PEPROCESS Process)
{
return Process->ProcessExiting;
return (BOOLEAN)Process->ProcessExiting;
}
/*
@ -1083,7 +1083,7 @@ NTAPI
PsSetProcessPriorityClass(PEPROCESS Process,
ULONG PriorityClass)
{
Process->PriorityClass = PriorityClass;
Process->PriorityClass = (UCHAR)PriorityClass;
}
/*

View file

@ -141,7 +141,7 @@ PspWriteTebImpersonationInfo(IN PETHREAD Thread,
}
/* Check if the thread is impersonating */
IsImpersonating = Thread->ActiveImpersonationInfo;
IsImpersonating = (BOOLEAN)Thread->ActiveImpersonationInfo;
if (IsImpersonating)
{
/* Set TEB data */

View file

@ -382,8 +382,8 @@ RtlpCreateUnicodeString(
Source,
Length);
UniDest->MaximumLength = Length;
UniDest->Length = Length - sizeof (WCHAR);
UniDest->MaximumLength = (USHORT)Length;
UniDest->Length = (USHORT)Length - sizeof (WCHAR);
return TRUE;
}

View file

@ -73,9 +73,9 @@ RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
{
RTL_OSVERSIONINFOEXW *InfoEx = (RTL_OSVERSIONINFOEXW *)lpVersionInformation;
InfoEx->wServicePackMajor = (NtOSCSDVersion >> 8) & 0xFF;
InfoEx->wServicePackMinor = NtOSCSDVersion & 0xFF;
InfoEx->wSuiteMask = SharedUserData->SuiteMask;
InfoEx->wServicePackMajor = (USHORT)(NtOSCSDVersion >> 8) & 0xFF;
InfoEx->wServicePackMinor = (USHORT)(NtOSCSDVersion & 0xFF);
InfoEx->wSuiteMask = (USHORT)SharedUserData->SuiteMask;
InfoEx->wProductType = SharedUserData->NtProductType;
}

View file

@ -810,7 +810,7 @@ SeQuerySecurityDescriptorInfo(IN PSECURITY_INFORMATION SecurityInformation,
/* Build the new security descrtiptor */
RtlCreateSecurityDescriptorRelative(RelSD,
SECURITY_DESCRIPTOR_REVISION);
RelSD->Control = Control;
RelSD->Control = (USHORT)Control;
Current = (ULONG_PTR)(RelSD + 1);

View file

@ -340,7 +340,7 @@ SeDefaultObjectMethod(PVOID Object,
RtlCreateSecurityDescriptor(NewSd,
SECURITY_DESCRIPTOR_REVISION1);
/* We always build a self-relative descriptor */
NewSd->Control = Control | SE_SELF_RELATIVE;
NewSd->Control = (USHORT)Control | SE_SELF_RELATIVE;
Current = (ULONG_PTR)NewSd + sizeof(SECURITY_DESCRIPTOR);
@ -754,7 +754,7 @@ SeAssignSecurity(PSECURITY_DESCRIPTOR _ParentDescriptor OPTIONAL,
RtlCreateSecurityDescriptor(Descriptor,
SECURITY_DESCRIPTOR_REVISION);
Descriptor->Control = Control | SE_SELF_RELATIVE;
Descriptor->Control = (USHORT)Control | SE_SELF_RELATIVE;
Current = (ULONG_PTR)Descriptor + sizeof(SECURITY_DESCRIPTOR);

View file

@ -621,7 +621,7 @@ SeImpersonateClient(IN PSECURITY_CLIENT_CONTEXT ClientContext,
PsImpersonateClient(ServerThread,
ClientContext->ClientToken,
1,
(ULONG)b,
b,
ClientContext->SecurityQos.ImpersonationLevel);
}