From 204acf76b03a03643a622949033e2a7dcad8269d Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Mon, 2 Jun 2008 10:21:49 +0000 Subject: [PATCH] Stefan Ginsberg - Remove ExTryToAcquireResourceExclusiveLite from NDK since it's not exported by NT kernel. - Add ObSetSecurityObjectByPointer, RtlInitAnsiStringEx (and implement it, rather straightforward) to NDK. - Uncomment exports in ntoskrnl_i386.def which are already implemented. - Add KeInvalidateAllCaches to ARM's stubs. svn path=/trunk/; revision=33825 --- reactos/include/ndk/exfuncs.h | 10 ------ reactos/include/ndk/obfuncs.h | 9 ++++++ reactos/include/ndk/rtlfuncs.h | 12 ++++++-- reactos/lib/rtl/unicode.c | 24 +++++++++++++++ reactos/ntoskrnl/include/internal/ex.h | 6 ++++ reactos/ntoskrnl/ke/arm/stubs_asm.s | 1 + reactos/ntoskrnl/ntoskrnl_i386.def | 42 +++++++++++++------------- 7 files changed, 71 insertions(+), 33 deletions(-) diff --git a/reactos/include/ndk/exfuncs.h b/reactos/include/ndk/exfuncs.h index 1221ad90271..88fdb07eb3f 100644 --- a/reactos/include/ndk/exfuncs.h +++ b/reactos/include/ndk/exfuncs.h @@ -96,16 +96,6 @@ ExfUnblockPushLock( PVOID CurrentWaitBlock ); -// -// Resource Functions -// -NTKERNELAPI -BOOLEAN -NTAPI -ExTryToAcquireResourceExclusiveLite( - IN PERESOURCE Resource -); - // // Handle Table Functions // diff --git a/reactos/include/ndk/obfuncs.h b/reactos/include/ndk/obfuncs.h index 6e86a599011..af48d6e5c31 100644 --- a/reactos/include/ndk/obfuncs.h +++ b/reactos/include/ndk/obfuncs.h @@ -108,6 +108,15 @@ ObReferenceObjectByName( OUT PVOID *Object ); +NTKERNELAPI +NTSTATUS +NTAPI +ObSetSecurityObjectByPointer( + IN PVOID Object, + IN SECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR SecurityDescriptor +); + NTKERNELAPI BOOLEAN NTAPI diff --git a/reactos/include/ndk/rtlfuncs.h b/reactos/include/ndk/rtlfuncs.h index f50322236d1..d1ec45a427c 100644 --- a/reactos/include/ndk/rtlfuncs.h +++ b/reactos/include/ndk/rtlfuncs.h @@ -1628,8 +1628,6 @@ RtlDowncaseUnicodeString( IN BOOLEAN AllocateDestinationString ); -#endif - NTSYSAPI NTSTATUS NTAPI @@ -1639,6 +1637,8 @@ RtlDuplicateUnicodeString( OUT PUNICODE_STRING DestinationString ); +#endif + NTSYSAPI BOOLEAN NTAPI @@ -1758,6 +1758,14 @@ RtlInitAnsiString( PCSZ SourceString ); +NTSYSAPI +NTSTATUS +NTAPI +RtlInitAnsiStringEx( + PANSI_STRING DestinationString, + PCSZ SourceString +); + // // OEM String Functions // diff --git a/reactos/lib/rtl/unicode.c b/reactos/lib/rtl/unicode.c index 90d12a669ab..afe29068046 100644 --- a/reactos/lib/rtl/unicode.c +++ b/reactos/lib/rtl/unicode.c @@ -432,6 +432,30 @@ RtlInitAnsiString(IN OUT PANSI_STRING DestinationString, DestinationString->Buffer = (PCHAR)SourceString; } +NTSTATUS +NTAPI +RtlInitAnsiStringEx(IN OUT PANSI_STRING DestinationString, + IN PCSZ SourceString) +{ + ULONG DestSize; + + if(SourceString) + { + DestSize = strlen(SourceString); + if (DestSize >= 0xFFFF) return STATUS_NAME_TOO_LONG; + DestinationString->Length = (USHORT)DestSize; + DestinationString->MaximumLength = (USHORT)DestSize + sizeof(CHAR); + } + else + { + DestinationString->Length = 0; + DestinationString->MaximumLength = 0; + } + + DestinationString->Buffer = (PCHAR)SourceString; + return STATUS_SUCCESS; + +} /* * @implemented * diff --git a/reactos/ntoskrnl/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h index 782d4934650..65df7d70e30 100644 --- a/reactos/ntoskrnl/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -1001,6 +1001,12 @@ ExReleasePushLock(PEX_PUSH_LOCK PushLock) /* OTHER FUNCTIONS **********************************************************/ +BOOLEAN +NTAPI +ExTryToAcquireResourceExclusiveLite( + IN PERESOURCE Resource +); + LONGLONG FASTCALL ExfpInterlockedExchange64( diff --git a/reactos/ntoskrnl/ke/arm/stubs_asm.s b/reactos/ntoskrnl/ke/arm/stubs_asm.s index 05696564848..c5d12e463bf 100644 --- a/reactos/ntoskrnl/ke/arm/stubs_asm.s +++ b/reactos/ntoskrnl/ke/arm/stubs_asm.s @@ -21,6 +21,7 @@ GENERATE_ARM_STUB KeFlushEntireTb GENERATE_ARM_STUB KeGetRecommendedSharedDataAlignment GENERATE_ARM_STUB KeIcacheFlushCount GENERATE_ARM_STUB KeInitializeInterrupt +GENERATE_ARM_STUB KeInvalidateAllCaches GENERATE_ARM_STUB KeNumberProcessors GENERATE_ARM_STUB KeQueryActiveProcessors GENERATE_ARM_STUB KeRaiseUserException diff --git a/reactos/ntoskrnl/ntoskrnl_i386.def b/reactos/ntoskrnl/ntoskrnl_i386.def index 418de7fc91b..d1448a6d1db 100644 --- a/reactos/ntoskrnl/ntoskrnl_i386.def +++ b/reactos/ntoskrnl/ntoskrnl_i386.def @@ -82,7 +82,7 @@ ExDeleteResourceLite@4 ExDesktopObjectType ExDisableResourceBoostLite@4 @ExEnterCriticalRegionAndAcquireFastMutexUnsafe@4 -;ExEnterCriticalRegionAndAcquireResourceExclusive +ExEnterCriticalRegionAndAcquireResourceExclusive@4 ;ExEnterCriticalRegionAndAcquireResourceShared ;ExEnterCriticalRegionAndAcquireSharedWaitForExclusive ExEnumHandleTable@16 @@ -137,7 +137,7 @@ ExRegisterCallback@12 ExReinitializeResourceLite@4 @ExReleaseFastMutexUnsafe@4 @ExReleaseFastMutexUnsafeAndLeaveCriticalRegion@4 -;ExReleaseResourceAndLeaveCriticalRegion +@ExReleaseResourceAndLeaveCriticalRegion@4 ExReleaseResourceForThreadLite@8 @ExReleaseResourceLite@4 ExReleaseRundownProtection=@ExfReleaseRundownProtection@4 @@ -158,8 +158,8 @@ ExVerifySuite@4 ExWaitForRundownProtectionRelease=@ExfWaitForRundownProtectionRelease@4 ExWaitForRundownProtectionReleaseCacheAware=@ExfWaitForRundownProtectionReleaseCacheAware@4 ExWindowStationObjectType DATA -;ExfAcquirePushLockExclusive -;ExfAcquirePushLockShared +@ExfAcquirePushLockExclusive@4 +@ExfAcquirePushLockShared@4 @ExfInterlockedAddUlong@12 @ExfInterlockedCompareExchange64@12 @ExfInterlockedInsertHeadList@12 @@ -167,11 +167,11 @@ ExWindowStationObjectType DATA @ExfInterlockedPopEntryList@8 @ExfInterlockedPushEntryList@12 @ExfInterlockedRemoveHeadList@8 -;ExfReleasePushLock -;ExfReleasePushLockExclusive -;ExfReleasePushLockShared -;ExfTryToWakePushLock -;ExfUnblockPushLock +@ExfReleasePushLock@4 +@ExfReleasePushLockExclusive@4 +@ExfReleasePushLockShared@4 +@ExfTryToWakePushLock@4 +@ExfUnblockPushLock@8 @Exfi386InterlockedDecrementLong@4 @Exfi386InterlockedExchangeUlong@8 @Exfi386InterlockedIncrementLong@4 @@ -199,7 +199,7 @@ FsRtlCheckLockForWriteAccess@8 FsRtlCheckOplock FsRtlCopyRead FsRtlCopyWrite -;FsRtlCreateSectionForDataScan +FsRtlCreateSectionForDataScan@40 FsRtlCurrentBatchOplock FsRtlDeleteKeyFromTunnelCache FsRtlDeleteTunnelCache @@ -549,7 +549,7 @@ KeAcquireInterruptSpinLock@4 KeAcquireSpinLockAtDpcLevel@4 ;KeAcquireSpinLockForDpc KeAddSystemServiceTable@20 -;KeAreAllApcsDisabled +KeAreAllApcsDisabled@0 KeAreApcsDisabled@0 KeAttachProcess@4 KeBugCheck@4 @@ -606,8 +606,8 @@ KeInsertHeadQueue@8 KeInsertQueue@8 KeInsertQueueApc@16 KeInsertQueueDpc@12 -;KeInvalidateAllCaches -;KeIpiGenericCall +KeInvalidateAllCaches@0 +KeIpiGenericCall@8 KeIsAttachedProcess@0 KeIsExecutingDpc@0 ;KeIsWaitListEmpty @@ -682,7 +682,7 @@ KeTerminateThread@4 ;KeTestSpinLock KeTickCount DATA @KeTryToAcquireGuardedMutex@4 -;KeTryToAcquireSpinLockAtDpcLevel +@KeTryToAcquireSpinLockAtDpcLevel@4 KeUnstackDetachProcess@4 KeUpdateRunTime@4 KeUpdateSystemTime@0 @@ -888,11 +888,11 @@ ObQueryObjectAuditingByHandle@8 ObReferenceObjectByHandle@24 ObReferenceObjectByName@32 ObReferenceObjectByPointer@16 -;ObReferenceSecurityDescriptor@8 +ObReferenceSecurityDescriptor@8 ObReleaseObjectSecurity@8 ;ObSetHandleAttributes@12 -;ObSetSecurityDescriptorInfo@24 -;ObSetSecurityObjectByPointer@12 +ObSetSecurityDescriptorInfo@24 +ObSetSecurityObjectByPointer@12 @ObfDereferenceObject@4 @ObfReferenceObject@4 ;PfxFindPrefix @@ -974,7 +974,7 @@ PsGetVersion@16 PsImpersonateClient@20 PsInitialSystemProcess DATA PsIsProcessBeingDebugged@4 -;PsIsSystempProcess +;PsIsSystemProcess PsIsSystemThread@4 PsIsThreadImpersonating@4 PsIsThreadTerminating@4 @@ -1018,7 +1018,7 @@ READ_REGISTER_USHORT@4 KeRosDumpStackFrames@8 RtlAbsoluteToSelfRelativeSD@12 RtlAddAccessAllowedAce@16 -;RtlAddAccessAllowedAceEx +RtlAddAccessAllowedAceEx@20 RtlAddAce@20 RtlAddAtomToAtomTable@12 RtlAddRange@36 @@ -1140,11 +1140,11 @@ RtlHashUnicodeString@16 RtlImageDirectoryEntryToData@16 RtlImageNtHeader@4 RtlInitAnsiString@8 -;RtlInitAnsiStringEx +RtlInitAnsiStringEx@8 RtlInitCodePageTable@8 RtlInitString@8 RtlInitUnicodeString@8 -;RtlInitUnicodeStringEx +RtlInitUnicodeStringEx@8 RtlInitializeBitMap@12 RtlInitializeGenericTable@20 RtlInitializeGenericTableAvl@20