Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

ntrtlp.h File Reference

#include <ntos.h>
#include <nturtl.h>
#include <zwapi.h>
#include "string.h"
#include "wchar.h"

Go to the source code of this file.

Classes

struct  _ALT_RESOURCE_MODULE

Defines

#define RtlpBitSetAnywhere(Byte)   RtlpBitsClearAnywhere[ (~(Byte) & 0xFF) ]
#define RtlpBitsSetLow(Byte)   RtlpBitsClearLow[ (~(Byte) & 0xFF) ]
#define RtlpBitsSetHigh(Byte)   RtlpBitsClearHigh[ (~(Byte) & 0xFF) ]
#define RtlpBitsSetTotal(Byte)   RtlpBitsClearTotal[ (~(Byte) & 0xFF) ]
#define LOBYTE(w)   ((UCHAR)((w)))
#define HIBYTE(w)   ((UCHAR)(((USHORT)((w)) >> 8) & 0xFF))
#define GET8(w)   ((ULONG)(((w) >> 8) & 0xff))
#define GETHI4(w)   ((ULONG)(((w) >> 4) & 0xf))
#define GETLO4(w)   ((ULONG)((w) & 0xf))
#define TRAVERSE844W(pTable, wch)   ( (pTable)[(pTable)[(pTable)[GET8((wch))] + GETHI4((wch))] + GETLO4((wch))] )
#define NLS_UPCASE(wch)
#define NLS_DOWNCASE(wch)
#define RTL_PAGED_CODE()
#define RtlpInitializeSListHead(_listhead_)   (_listhead_)->Alignment = 0
#define RtlpQueryDepthSList(_listhead_)   (_listhead_)->Depth
#define NO_ALTERNATE_RESOURCE_MODULE   (PVOID)(-1)

Typedefs

typedef NTSTATUS(* PRTL_COMPRESS_WORKSPACE_SIZE )(IN USHORT CompressionEngine, OUT PULONG CompressBufferWorkSpaceSize, OUT PULONG CompressFragmentWorkSpaceSize)
typedef NTSTATUS(* PRTL_COMPRESS_BUFFER )(IN USHORT CompressionEngine, IN PUCHAR UncompressedBuffer, IN ULONG UncompressedBufferSize, OUT PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, IN ULONG UncompressedChunkSize, OUT PULONG FinalCompressedSize, IN PVOID WorkSpace)
typedef NTSTATUS(* PRTL_DECOMPRESS_BUFFER )(OUT PUCHAR UncompressedBuffer, IN ULONG UncompressedBufferSize, IN PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, OUT PULONG FinalUncompressedSize)
typedef NTSTATUS(* PRTL_DECOMPRESS_FRAGMENT )(OUT PUCHAR UncompressedFragment, IN ULONG UncompressedFragmentSize, IN PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, IN ULONG FragmentOffset, OUT PULONG FinalUncompressedSize, IN PVOID WorkSpace)
typedef NTSTATUS(* PRTL_DESCRIBE_CHUNK )(IN OUT PUCHAR *CompressedBuffer, IN PUCHAR EndOfCompressedBufferPlus1, OUT PUCHAR *ChunkBuffer, OUT PULONG ChunkSize)
typedef NTSTATUS(* PRTL_RESERVE_CHUNK )(IN OUT PUCHAR *CompressedBuffer, IN PUCHAR EndOfCompressedBufferPlus1, OUT PUCHAR *ChunkBuffer, IN ULONG ChunkSize)
typedef _ALT_RESOURCE_MODULE ALT_RESOURCE_MODULE
typedef _ALT_RESOURCE_MODULEPALT_RESOURCE_MODULE

Functions

VOID RtlpGetStackLimits (OUT PULONG_PTR LowLimit, OUT PULONG_PTR HighLimit)
LONG LdrpCompareResourceNames (IN ULONG ResourceName, IN PIMAGE_RESOURCE_DIRECTORY ResourceDirectory, IN PIMAGE_RESOURCE_DIRECTORY_ENTRY ResourceDirectoryEntry)
NTSTATUS LdrpSearchResourceSection (IN PVOID DllHandle, IN PULONG_PTR ResourceIdPath, IN ULONG ResourceIdPathLength, IN BOOLEAN FindDirectoryEntry, OUT PVOID *ResourceDirectoryOrData)
LONG LdrpCompareResourceNames_U (IN ULONG_PTR ResourceName, IN PIMAGE_RESOURCE_DIRECTORY ResourceDirectory, IN PIMAGE_RESOURCE_DIRECTORY_ENTRY ResourceDirectoryEntry)
NTSTATUS LdrpSearchResourceSection_U (IN PVOID DllHandle, IN PULONG_PTR ResourceIdPath, IN ULONG ResourceIdPathLength, IN BOOLEAN FindDirectoryEntry, IN BOOLEAN ExactMatchOnly, OUT PVOID *ResourceDirectoryOrData)
NTSTATUS LdrpAccessResourceData (IN PVOID DllHandle, IN PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry, OUT PVOID *Address OPTIONAL, OUT PULONG Size OPTIONAL)
VOID RtlpAnsiPszToUnicodePsz (IN PCHAR AnsiString, IN WCHAR *UnicodeString, IN USHORT AnsiStringLength)
BOOLEAN RtlpDidUnicodeToOemWork (IN POEM_STRING OemString, IN PUNICODE_STRING UnicodeString)
NTSTATUS RtlCompressWorkSpaceSizeLZNT1 (IN USHORT CompressionEngine, OUT PULONG CompressBufferWorkSpaceSize, OUT PULONG CompressFragmentWorkSpaceSize)
NTSTATUS RtlCompressBufferLZNT1 (IN USHORT CompressionEngine, IN PUCHAR UncompressedBuffer, IN ULONG UncompressedBufferSize, OUT PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, IN ULONG UncompressedChunkSize, OUT PULONG FinalCompressedSize, IN PVOID WorkSpace)
NTSTATUS RtlDecompressBufferLZNT1 (OUT PUCHAR UncompressedBuffer, IN ULONG UncompressedBufferSize, IN PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, OUT PULONG FinalUncompressedSize)
NTSTATUS RtlDecompressFragmentLZNT1 (OUT PUCHAR UncompressedFragment, IN ULONG UncompressedFragmentSize, IN PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, IN ULONG FragmentOffset, OUT PULONG FinalUncompressedSize, IN PVOID WorkSpace)
NTSTATUS RtlDescribeChunkLZNT1 (IN OUT PUCHAR *CompressedBuffer, IN PUCHAR EndOfCompressedBufferPlus1, OUT PUCHAR *ChunkBuffer, OUT PULONG ChunkSize)
NTSTATUS RtlReserveChunkLZNT1 (IN OUT PUCHAR *CompressedBuffer, IN PUCHAR EndOfCompressedBufferPlus1, OUT PUCHAR *ChunkBuffer, IN ULONG ChunkSize)
NTSTATUS DebugPrint (IN PSTRING Output)
ULONG DebugPrompt (IN PSTRING Output, IN PSTRING Input)
PVOID FASTCALL RtlpInterlockedPopEntrySList (IN PSLIST_HEADER ListHead)
PVOID FASTCALL RtlpInterlockedPushEntrySList (IN PSLIST_HEADER ListHead, IN PVOID ListEntry)
ULONG RtlpLogExceptionHandler (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextRecord, IN ULONG_PTR ControlPc, IN PVOID HandlerData, IN ULONG Size)
VOID RtlpLogLastExceptionDisposition (IN ULONG LogIndex, IN EXCEPTION_DISPOSITION Disposition)
BOOLEAN LdrpVerifyAlternateResourceModule (IN PVOID Module, IN PVOID AlternateModule)
BOOLEAN LdrpSetAlternateResourceModuleHandle (IN PVOID Module, IN PVOID AlternateModule)

Variables

CONST CCHAR RtlpBitsClearAnywhere [256]
CONST CCHAR RtlpBitsClearLow [256]
CONST CCHAR RtlpBitsClearHigh [256]
CONST CCHAR RtlpBitsClearTotal [256]
PUSHORT Nls844UnicodeUpcaseTable
PUSHORT Nls844UnicodeLowercaseTable


Define Documentation

#define GET8  )     ((ULONG)(((w) >> 8) & 0xff))
 

Definition at line 185 of file ntrtlp.h.

#define GETHI4  )     ((ULONG)(((w) >> 4) & 0xf))
 

Definition at line 186 of file ntrtlp.h.

#define GETLO4  )     ((ULONG)((w) & 0xf))
 

Definition at line 187 of file ntrtlp.h.

#define HIBYTE  )     ((UCHAR)(((USHORT)((w)) >> 8) & 0xFF))
 

Definition at line 184 of file ntrtlp.h.

Referenced by CBNcCreateHandler(), DoStringPaste(), ECImeComposition(), GetChar(), GetSystemLineJ(), HFill(), ImmEscapeW(), InternalCreateDialog(), IsDbcsExemptionForHighAnsi(), MapScancode(), MESSAGECALL(), MLChar(), NotepadPrint(), RtlIsTextUnicode(), RtlIsValidOemCharacter(), RtlUnicodeToCustomCPN(), RtlUnicodeToMultiByteN(), RtlUnicodeToMultiByteSize(), RtlUnicodeToOemN(), RtlUpcaseUnicodeToCustomCPN(), RtlUpcaseUnicodeToMultiByteN(), RtlUpcaseUnicodeToOemN(), RtlUpperChar(), RtlWCSMessageWParamCharToMB(), StaticCallback(), TransGetMNTable(), TransHanjaMode(), ValidateState(), WINNLSTranslateMessageK(), xxxActivateOnMinimize(), xxxBNDrawText(), xxxCallJournalRecordHook(), xxxInternalToUnicode(), xxxKeyEvent(), xxxMinMaximize(), xxxMKMouseMove(), xxxMS_TrackMove(), xxxNumpadCursor(), xxxTrackBox(), xxxTrackThumb(), and zzzChangeStates().

#define LOBYTE  )     ((UCHAR)((w)))
 

Definition at line 183 of file ntrtlp.h.

Referenced by _GetKeyNameText(), _HasCaptionIcon(), _RealChildWindowFromPoint(), BNCalcRect(), ButtonWndProcWorker(), DefFrameProcWorker(), DialogBox2(), DoStringPaste(), DWP_SetHotKey(), ECImeComposition(), FindNCHit(), GetAlignment(), GetChar(), GetSystemLineJ(), HandleSysKeyEvent(), ImmEscapeW(), InitWindowClass(), InternalMapVirtualKeyEx(), IsDialogMessageW(), IsPushButton(), MapScancode(), MESSAGECALL(), MLChar(), NlsNumpadModeProc(), NotepadPrint(), OemKeyScan(), PixieHack(), RtlIsTextUnicode(), RtlIsValidOemCharacter(), RtlUnicodeToCustomCPN(), RtlUnicodeToMultiByteN(), RtlUnicodeToOemN(), RtlUpcaseUnicodeToCustomCPN(), RtlUpcaseUnicodeToMultiByteN(), RtlUpcaseUnicodeToOemN(), RtlUpperChar(), RtlWCSMessageWParamCharToMB(), set_opaque_bkgnd_proc(), SetFont(), SetScreenColors(), SetWindowState(), SLChar(), StaticCallback(), StaticWndProcWorker(), TransGetMNTable(), TransHanjaMode(), TranslateInjectedVKey(), ValidateState(), ValidateZorder(), VKFromVSC(), WINNLSTranslateMessageK(), WWSB_ConsolePolyTextOut(), WWSB_WriteRegionToScreen(), xxxActivateOnMinimize(), xxxBNDrawText(), xxxBNInitDC(), xxxBNPaint(), xxxCalcClientRect(), xxxCallJournalPlaybackHook(), xxxCallJournalRecordHook(), xxxCBCreateHandler(), xxxCheckFullScreen(), xxxGetTitleBarInfo(), xxxInternalKeyEventDirect(), xxxInternalToUnicode(), xxxKENLSProcs(), xxxMKMouseMove(), xxxNumpadCursor(), xxxRedrawTitle(), xxxSBWndProc(), xxxScanSysQueue(), xxxSendInput(), xxxSetSysMenu(), xxxSetWindowPos(), xxxShowWindow(), xxxSkipSysMsg(), xxxStaticPaint(), and zzzChangeStates().

#define NLS_DOWNCASE wch   ) 
 

Value:

( \ ((wch) < 'A' ? \ (wch) \ : \ ((wch) <= 'Z' ? \ (wch) + ('a'-'A') \ : \ ((WCHAR)((wch) + TRAVERSE844W(Nls844UnicodeLowercaseTable,(wch)))) \ ) \ ) \ )

Definition at line 231 of file ntrtlp.h.

Referenced by RtlDowncaseUnicodeString().

#define NLS_UPCASE wch   ) 
 

Value:

( \ ((wch) < 'a' ? \ (wch) \ : \ ((wch) <= 'z' ? \ (wch) - ('a'-'A') \ : \ ((WCHAR)((wch) + TRAVERSE844W(Nls844UnicodeUpcaseTable,(wch)))) \ ) \ ) \ )

Definition at line 219 of file ntrtlp.h.

Referenced by CompareUnicodeStrings(), RtlCompareUnicodeString(), RtlEqualUnicodeString(), RtlIsValidOemCharacter(), RtlPrefixUnicodeString(), RtlUpcaseUnicodeChar(), RtlUpcaseUnicodeString(), RtlUpcaseUnicodeToCustomCPN(), RtlUpcaseUnicodeToMultiByteN(), RtlUpcaseUnicodeToOemN(), and RtlUpperChar().

#define NO_ALTERNATE_RESOURCE_MODULE   (PVOID)(-1)
 

Definition at line 485 of file ntrtlp.h.

Referenced by LdrFlushAlternateResourceModules(), LdrLoadAlternateResourceModule(), and LdrUnloadAlternateResourceModule().

 
#define RTL_PAGED_CODE  ) 
 

Definition at line 246 of file ntrtlp.h.

Referenced by ChkSum(), CompareNamesCaseSensitive(), CompareUnicodeStrings(), ComputeNameLength(), ComputeUnicodeNameLength(), LdrAccessResource(), LdrFindResource_U(), LdrFindResourceDirectory_U(), LdrpAccessResourceData(), LdrProcessRelocationBlock(), LdrpSearchResourceSection_U(), LdrRelocateImage(), LdrVerifyMappedImageMatchesChecksum(), PfxFindPrefix(), PfxInitialize(), PfxInsertPrefix(), PfxRemovePrefix(), RtlAbortRXact(), RtlAbsoluteToSelfRelativeSD(), RtlAcquirePebLock(), RtlAddAccessAllowedAce(), RtlAddAccessAllowedAceEx(), RtlAddAccessAllowedObjectAce(), RtlAddAccessDeniedAce(), RtlAddAccessDeniedAceEx(), RtlAddAccessDeniedObjectAce(), RtlAddAce(), RtlAddActionToRXact(), RtlAddAttributeActionToRXact(), RtlAddAuditAccessAce(), RtlAddAuditAccessAceEx(), RtlAddAuditAccessObjectAce(), RtlAddCompoundAce(), RtlAddRange(), RtlAdjustPrivilege(), RtlAllocateAndInitializeSid(), RtlAllocateHeap(), RtlAllocateHeapSlowly(), RtlAnsiCharToUnicodeChar(), RtlAnsiStringToUnicodeString(), RtlApplyRXact(), RtlApplyRXactNoFlush(), RtlAreAllAccessesGranted(), RtlAreAnyAccessesGranted(), RtlCheckRegistryKey(), RtlComputeLfnChecksum(), RtlConsoleMultiByteToUnicodeN(), RtlConvertSidToUnicodeString(), RtlCopyLuid(), RtlCopyLuidAndAttributesArray(), RtlCopyRangeList(), RtlCopySid(), RtlCopySidAndAttributesArray(), RtlCreateAcl(), RtlCreateHeap(), RtlCreateRegistryKey(), RtlCreateSecurityDescriptor(), RtlCreateSecurityDescriptorRelative(), RtlCreateUnicodeString(), RtlCustomCPToUnicodeN(), RtlDeleteAce(), RtlDeleteOwnersRanges(), RtlDeleteRange(), RtlDeleteRegistryValue(), RtlDestroyHeap(), RtlDnsHostNameToComputerName(), RtlDowncaseUnicodeString(), RtlEqualDomainName(), RtlEqualLuid(), RtlEqualPrefixSid(), RtlEqualSid(), RtlEqualUnicodeString(), RtlEraseUnicodeString(), RtlExpandEnvironmentStrings_U(), RtlFindLastBackwardRunClear(), RtlFindMessage(), RtlFindRange(), RtlFindUnicodePrefix(), RtlFirstFreeAce(), RtlFreeAnsiString(), RtlFreeHeap(), RtlFreeHeapSlowly(), RtlFreeOemString(), RtlFreeRangeList(), RtlFreeSid(), RtlFreeUnicodeString(), RtlGetAce(), RtlGetControlSecurityDescriptor(), RtlGetDaclSecurityDescriptor(), RtlGetDefaultCodePage(), RtlGetFirstRange(), RtlGetGroupSecurityDescriptor(), RtlGetLastRange(), RtlGetNextRange(), RtlGetNtProductType(), RtlGetOwnerSecurityDescriptor(), RtlGetSaclSecurityDescriptor(), RtlGUIDFromString(), RtlIdentifierAuthoritySid(), RtlImpersonateSelf(), RtlInitCodePageTable(), RtlInitializeBitMap(), RtlInitializeContext(), RtlInitializeRangeList(), RtlInitializeRXact(), RtlInitializeSid(), RtlInitializeUnicodePrefix(), RtlInitNlsTables(), RtlInsertUnicodePrefix(), RtlInvertRangeList(), RtlIsRangeAvailable(), RtlLengthRequiredSid(), RtlLengthSecurityDescriptor(), RtlLengthSid(), RtlLengthSidAsUnicodeString(), RtlLengthUsedSecurityDescriptor(), RtlLockHeap(), RtlMakeSelfRelativeSD(), RtlMapGenericMask(), RtlMergeRangeLists(), RtlMultiByteToUnicodeN(), RtlMultiByteToUnicodeSize(), RtlNextUnicodePrefix(), RtlOemStringToCountedUnicodeString(), RtlOemStringToUnicodeString(), RtlOemToUnicodeN(), RtlOpenCurrentUser(), RtlpAddIntersectingRanges(), RtlpAddKnownAce(), RtlpAddKnownObjectAce(), RtlpAddRange(), RtlpAddToMergedRange(), RtlpApplyAclToObject(), RtlpCheckBusyBlockTail(), RtlpCoalesceFreeBlocks(), RtlpCoalesceHeap(), RtlpCompareKnownAces(), RtlpCompareKnownObjectAces(), RtlpComputeMergedAcl(), RtlpComputeMergedAcl2(), RtlpConvertAclToAutoInherit(), RtlpConvertToAutoInheritSecurityObject(), RtlpConvertToMergedRange(), RtlpCopyAces(), RtlpCopyEffectiveAce(), RtlpCopyRangeListEntry(), RtlpCreateRangeListEntry(), RtlpCreateServerAcl(), RtlpCreateUnCommittedRange(), RtlpDeCommitFreeBlock(), RtlpDeleteFromMergedRange(), RtlpDeleteRangeListEntry(), RtlpDestroyHeapSegment(), RtlpDestroyUnCommittedRange(), RtlpDidUnicodeToOemWork(), RtlpExtendHeap(), RtlpFindAndCommitPages(), RtlpGenerateInheritAcl(), RtlpGenerateInheritedAce(), RtlpGetSizeOfBigBlock(), RtlpInheritAcl(), RtlpInheritAcl2(), RtlpInitializeHeapSegment(), RtlpInsertFreeBlock(), RtlpInsertUnCommittedPages(), RtlpIsDuplicateAce(), RtlpIsRangeAvailable(), RtlpNtCreateKey(), RtlpNtEnumerateSubKey(), RtlpNtMakeTemporaryKey(), RtlpNtOpenKey(), RtlpNtQueryValueKey(), RtlpNtSetValueKey(), RtlpQuerySecurityDescriptor(), RtlpSetSecurityObject(), RtlpValidateHeap(), RtlpValidateHeapSegment(), RtlpValidOwnerSubjectContext(), RtlQueryInformationAcl(), RtlQueryRegistryValues(), RtlQueryTimeZoneInformation(), RtlRandom(), RtlReleasePebLock(), RtlRemoteCall(), RtlRemoveUnicodePrefix(), RtlResetRtlTranslations(), RtlRunDecodeUnicodeString(), RtlRunEncodeUnicodeString(), RtlSelfRelativeToAbsoluteSD(), RtlSelfRelativeToAbsoluteSD2(), RtlSetActiveTimeBias(), RtlSetAttributesSecurityDescriptor(), RtlSetDaclSecurityDescriptor(), RtlSetGroupSecurityDescriptor(), RtlSetInformationAcl(), RtlSetOwnerSecurityDescriptor(), RtlSetSaclSecurityDescriptor(), RtlSetTimeZoneInformation(), RtlStartRXact(), RtlStringFromGUID(), RtlSubAuthorityCountSid(), RtlSubAuthoritySid(), RtlUnicodeStringToAnsiString(), RtlUnicodeStringToCountedOemString(), RtlUnicodeStringToOemString(), RtlUnicodeToCustomCPN(), RtlUnicodeToMultiByteN(), RtlUnicodeToMultiByteSize(), RtlUnicodeToOemN(), RtlUnlockHeap(), RtlUpcaseUnicodeChar(), RtlUpcaseUnicodeString(), RtlUpcaseUnicodeStringToAnsiString(), RtlUpcaseUnicodeStringToCountedOemString(), RtlUpcaseUnicodeStringToOemString(), RtlUpcaseUnicodeToCustomCPN(), RtlUpcaseUnicodeToMultiByteN(), RtlUpcaseUnicodeToOemN(), RtlValidAcl(), RtlValidSecurityDescriptor(), RtlValidSid(), RtlWriteRegistryValue(), RtlxAnsiStringToUnicodeSize(), RtlxOemStringToUnicodeSize(), RtlxUnicodeStringToAnsiSize(), RtlxUnicodeStringToOemSize(), and RtlZeroHeap().

#define RtlpBitSetAnywhere Byte   )     RtlpBitsClearAnywhere[ (~(Byte) & 0xFF) ]
 

Definition at line 144 of file ntrtlp.h.

Referenced by RtlFindSetBits().

#define RtlpBitsSetHigh Byte   )     RtlpBitsClearHigh[ (~(Byte) & 0xFF) ]
 

Definition at line 160 of file ntrtlp.h.

Referenced by RtlFindSetBits().

#define RtlpBitsSetLow Byte   )     RtlpBitsClearLow[ (~(Byte) & 0xFF) ]
 

Definition at line 152 of file ntrtlp.h.

Referenced by RtlFindSetBits().

#define RtlpBitsSetTotal Byte   )     RtlpBitsClearTotal[ (~(Byte) & 0xFF) ]
 

Definition at line 167 of file ntrtlp.h.

Referenced by RtlNumberOfSetBits().

#define RtlpInitializeSListHead _listhead_   )     (_listhead_)->Alignment = 0
 

Definition at line 405 of file ntrtlp.h.

Referenced by RtlpInitializeHeapLookaside().

#define RtlpQueryDepthSList _listhead_   )     (_listhead_)->Depth
 

Definition at line 431 of file ntrtlp.h.

Referenced by RtlpFreeToHeapLookaside().

#define TRAVERSE844W pTable,
wch   )     ( (pTable)[(pTable)[(pTable)[GET8((wch))] + GETHI4((wch))] + GETLO4((wch))] )
 

Definition at line 206 of file ntrtlp.h.


Typedef Documentation

typedef struct _ALT_RESOURCE_MODULE ALT_RESOURCE_MODULE
 

typedef struct _ALT_RESOURCE_MODULE * PALT_RESOURCE_MODULE
 

typedef NTSTATUS(* PRTL_COMPRESS_BUFFER)(IN USHORT CompressionEngine, IN PUCHAR UncompressedBuffer, IN ULONG UncompressedBufferSize, OUT PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, IN ULONG UncompressedChunkSize, OUT PULONG FinalCompressedSize, IN PVOID WorkSpace)
 

Definition at line 262 of file ntrtlp.h.

typedef NTSTATUS(* PRTL_COMPRESS_WORKSPACE_SIZE)(IN USHORT CompressionEngine, OUT PULONG CompressBufferWorkSpaceSize, OUT PULONG CompressFragmentWorkSpaceSize)
 

Definition at line 256 of file ntrtlp.h.

typedef NTSTATUS(* PRTL_DECOMPRESS_BUFFER)(OUT PUCHAR UncompressedBuffer, IN ULONG UncompressedBufferSize, IN PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, OUT PULONG FinalUncompressedSize)
 

Definition at line 273 of file ntrtlp.h.

typedef NTSTATUS(* PRTL_DECOMPRESS_FRAGMENT)(OUT PUCHAR UncompressedFragment, IN ULONG UncompressedFragmentSize, IN PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, IN ULONG FragmentOffset, OUT PULONG FinalUncompressedSize, IN PVOID WorkSpace)
 

Definition at line 281 of file ntrtlp.h.

typedef NTSTATUS(* PRTL_DESCRIBE_CHUNK)(IN OUT PUCHAR *CompressedBuffer, IN PUCHAR EndOfCompressedBufferPlus1, OUT PUCHAR *ChunkBuffer, OUT PULONG ChunkSize)
 

Definition at line 291 of file ntrtlp.h.

typedef NTSTATUS(* PRTL_RESERVE_CHUNK)(IN OUT PUCHAR *CompressedBuffer, IN PUCHAR EndOfCompressedBufferPlus1, OUT PUCHAR *ChunkBuffer, IN ULONG ChunkSize)
 

Definition at line 298 of file ntrtlp.h.


Function Documentation

NTSTATUS DebugPrint IN PSTRING  Output  ) 
 

Definition at line 44 of file debug3.c.

References DebugService().

00047 { 00048 return DebugService( BREAKPOINT_PRINT, Output, 0 ); 00049 }

ULONG DebugPrompt IN PSTRING  Output,
IN PSTRING  Input
 

Definition at line 53 of file debug3.c.

References DebugService().

Referenced by DbgPrompt().

00057 { 00058 return DebugService( BREAKPOINT_PROMPT, Output, Input ); 00059 }

NTSTATUS LdrpAccessResourceData IN PVOID  DllHandle,
IN PIMAGE_RESOURCE_DATA_ENTRY  ResourceDataEntry,
OUT PVOID *Address  OPTIONAL,
OUT PULONG Size  OPTIONAL
 

Definition at line 96 of file ldrrsrc.c.

References EXCEPTION_EXECUTE_HANDLER, LdrLoadAlternateResourceModule(), NT_SUCCESS, NtQueryVirtualMemory(), NTSTATUS(), NULL, RTL_PAGED_CODE, RtlAddressInSectionTable(), RtlImageDirectoryEntryToData(), RtlImageNtHeader(), RtlSectionTableFromVirtualAddress(), Size, Status, and TRUE.

Referenced by LdrAccessResource(), LdrpGetFileVersion(), LdrQueryApplicationCompatibilityGoo(), and RtlFindMessage().

00105 : 00106 00107 This function returns the data necessary to actually examine the 00108 contents of a particular resource. 00109 00110 Arguments: 00111 00112 DllHandle - Supplies a handle to the image file that the resource is 00113 contained in. 00114 00115 ResourceDataEntry - Supplies a pointer to the resource data entry in 00116 the resource data directory of the image file specified by the 00117 DllHandle parameter. This pointer should have been one returned 00118 by the LdrFindResource function. 00119 00120 Address - Optional pointer to a variable that will receive the 00121 address of the resource specified by the first two parameters. 00122 00123 Size - Optional pointer to a variable that will receive the size of 00124 the resource specified by the first two parameters. 00125 00126 00127 Return Value: 00128 00129 TBD 00130 00131 --*/ 00132 00133 { 00134 PIMAGE_RESOURCE_DIRECTORY ResourceDirectory; 00135 ULONG ResourceSize; 00136 PIMAGE_NT_HEADERS NtHeaders; 00137 ULONG_PTR VirtualAddressOffset; 00138 PIMAGE_SECTION_HEADER NtSection; 00139 00140 RTL_PAGED_CODE(); 00141 00142 #ifndef NTOS_KERNEL_RUNTIME 00143 ResourceDirectory = (PIMAGE_RESOURCE_DIRECTORY) 00144 RtlImageDirectoryEntryToData(DllHandle, 00145 TRUE, 00146 IMAGE_DIRECTORY_ENTRY_RESOURCE, 00147 &ResourceSize 00148 ); 00149 if (!ResourceDirectory) { 00150 return( STATUS_RESOURCE_DATA_NOT_FOUND ); 00151 } 00152 00153 if ((ULONG_PTR)ResourceDataEntry < (ULONG_PTR) ResourceDirectory ){ 00154 DllHandle = LdrLoadAlternateResourceModule (DllHandle, NULL); 00155 } else{ 00156 NtHeaders = RtlImageNtHeader( 00157 (PVOID)((ULONG_PTR)DllHandle & ~0x00000001) 00158 ); 00159 if (NtHeaders) { 00160 // Find the bounds of the image so we can see if this resource entry is in an alternate 00161 // resource dll. 00162 00163 ULONG_PTR ImageStart = (ULONG_PTR)DllHandle & ~0x00000001; 00164 SIZE_T ImageSize = 0; 00165 00166 if ((ULONG_PTR)DllHandle & 0x00000001) { 00167 // mapped as datafile. Ask mm for the size 00168 NTSTATUS Status; 00169 MEMORY_BASIC_INFORMATION MemInfo; 00170 00171 Status = NtQueryVirtualMemory( 00172 NtCurrentProcess(), 00173 (PVOID) ImageStart, 00174 MemoryBasicInformation, 00175 (PVOID)&MemInfo, 00176 sizeof(MemInfo), 00177 NULL 00178 ); 00179 00180 if ( !NT_SUCCESS(Status) ) { 00181 ImageSize = 0; 00182 } else { 00183 ImageSize = MemInfo.RegionSize; 00184 } 00185 } else { 00186 ImageSize = ((PIMAGE_NT_HEADERS32)NtHeaders)->OptionalHeader.SizeOfImage; 00187 } 00188 00189 if (!(((ULONG_PTR)ResourceDataEntry >= ImageStart) && ((ULONG_PTR)ResourceDataEntry < (ImageStart + ImageSize)))) { 00190 // Doesn't fall within the specified image. Must be an alternate dll. 00191 DllHandle = LdrLoadAlternateResourceModule (DllHandle, NULL); 00192 } 00193 } 00194 } 00195 00196 if (!DllHandle){ 00197 return ( STATUS_RESOURCE_DATA_NOT_FOUND ); 00198 } 00199 00200 #endif 00201 try { 00202 ResourceDirectory = (PIMAGE_RESOURCE_DIRECTORY) 00203 RtlImageDirectoryEntryToData(DllHandle, 00204 TRUE, 00205 IMAGE_DIRECTORY_ENTRY_RESOURCE, 00206 &ResourceSize 00207 ); 00208 if (!ResourceDirectory) { 00209 return( STATUS_RESOURCE_DATA_NOT_FOUND ); 00210 } 00211 00212 if ((ULONG_PTR)DllHandle & 0x00000001) { 00213 ULONG ResourceRVA; 00214 DllHandle = (PVOID)((ULONG_PTR)DllHandle & ~0x00000001); 00215 NtHeaders = RtlImageNtHeader( DllHandle ); 00216 if (NtHeaders->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) { 00217 ResourceRVA=((PIMAGE_NT_HEADERS32)NtHeaders)->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_RESOURCE ].VirtualAddress; 00218 } else if (NtHeaders->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) { 00219 ResourceRVA=((PIMAGE_NT_HEADERS64)NtHeaders)->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_RESOURCE ].VirtualAddress; 00220 } else { 00221 ResourceRVA = 0; 00222 } 00223 00224 if (!ResourceRVA) { 00225 return( STATUS_RESOURCE_DATA_NOT_FOUND ); 00226 } 00227 00228 VirtualAddressOffset = (ULONG_PTR)DllHandle + ResourceRVA - (ULONG_PTR)ResourceDirectory; 00229 00230 // 00231 // Now, we must check to see if the resource is not in the 00232 // same section as the resource table. If it's in .rsrc1, 00233 // we've got to adjust the RVA in the ResourceDataEntry 00234 // to point to the correct place in the non-VA data file. 00235 // 00236 NtSection= RtlSectionTableFromVirtualAddress( NtHeaders, DllHandle, ResourceRVA); 00237 00238 if (!NtSection) { 00239 return( STATUS_RESOURCE_DATA_NOT_FOUND ); 00240 } 00241 00242 if ( ResourceDataEntry->OffsetToData > NtSection->Misc.VirtualSize ) { 00243 ULONG rva; 00244 00245 rva = NtSection->VirtualAddress; 00246 NtSection= RtlSectionTableFromVirtualAddress(NtHeaders, 00247 DllHandle, 00248 ResourceDataEntry->OffsetToData 00249 ); 00250 VirtualAddressOffset += 00251 ((ULONG_PTR)NtSection->VirtualAddress - rva) - 00252 ((ULONG_PTR)RtlAddressInSectionTable ( NtHeaders, DllHandle, NtSection->VirtualAddress ) - (ULONG_PTR)ResourceDirectory); 00253 } 00254 } 00255 else { 00256 VirtualAddressOffset = 0; 00257 } 00258 00259 if (ARGUMENT_PRESENT( Address )) { 00260 *Address = (PVOID)( (PCHAR)DllHandle + 00261 (ResourceDataEntry->OffsetToData - VirtualAddressOffset) 00262 ); 00263 } 00264 00265 if (ARGUMENT_PRESENT( Size )) { 00266 *Size = ResourceDataEntry->Size; 00267 } 00268 } 00269 except (EXCEPTION_EXECUTE_HANDLER) { 00270 return GetExceptionCode(); 00271 } 00272 00273 return( STATUS_SUCCESS ); 00274 }

LONG LdrpCompareResourceNames IN ULONG  ResourceName,
IN PIMAGE_RESOURCE_DIRECTORY  ResourceDirectory,
IN PIMAGE_RESOURCE_DIRECTORY_ENTRY  ResourceDirectoryEntry
 

LONG LdrpCompareResourceNames_U IN ULONG_PTR  ResourceName,
IN PIMAGE_RESOURCE_DIRECTORY  ResourceDirectory,
IN PIMAGE_RESOURCE_DIRECTORY_ENTRY  ResourceDirectoryEntry
 

Definition at line 451 of file ldrrsrc.c.

Referenced by LdrEnumResources(), and LdrpSearchResourceSection_U().

00456 { 00457 LONG li; 00458 PIMAGE_RESOURCE_DIR_STRING_U ResourceNameString; 00459 00460 if (ResourceName & LDR_RESOURCE_ID_NAME_MASK) { 00461 if (!ResourceDirectoryEntry->NameIsString) { 00462 return( -1 ); 00463 } 00464 00465 ResourceNameString = (PIMAGE_RESOURCE_DIR_STRING_U) 00466 ((PCHAR)ResourceDirectory + ResourceDirectoryEntry->NameOffset); 00467 00468 li = wcsncmp( (LPWSTR)ResourceName, 00469 ResourceNameString->NameString, 00470 ResourceNameString->Length 00471 ); 00472 00473 if (!li && wcslen((PWSTR)ResourceName) != ResourceNameString->Length) { 00474 return( 1 ); 00475 } 00476 00477 return(li); 00478 } 00479 else { 00480 if (ResourceDirectoryEntry->NameIsString) { 00481 return( 1 ); 00482 } 00483 00484 return( (ULONG)(ResourceName - ResourceDirectoryEntry->Name) ); 00485 } 00486 }

NTSTATUS LdrpSearchResourceSection IN PVOID  DllHandle,
IN PULONG_PTR  ResourceIdPath,
IN ULONG  ResourceIdPathLength,
IN BOOLEAN  FindDirectoryEntry,
OUT PVOID *  ResourceDirectoryOrData
 

NTSTATUS LdrpSearchResourceSection_U IN PVOID  DllHandle,
IN PULONG_PTR  ResourceIdPath,
IN ULONG  ResourceIdPathLength,
IN BOOLEAN  FindDirectoryEntry,
IN BOOLEAN  ExactMatchOnly,
OUT PVOID *  ResourceDirectoryOrData
 

Definition at line 492 of file ldrrsrc.c.

References dir(), EXCEPTION_EXECUTE_HANDLER, FALSE, InstallLangId, LdrLoadAlternateResourceModule(), LdrpCompareResourceNames_U(), n, NT_SUCCESS, NtQueryDefaultLocale(), NtQueryDefaultUILanguage(), NtQueryInstallUILanguage(), NTSTATUS(), NULL, PsDefaultSystemLocaleId, PsInstallUILanguageId, RTL_PAGED_CODE, RtlImageDirectoryEntryToData(), Status, TRUE, UILangId, USE_FIRSTAVAILABLE_LANGID, and USHORT.

Referenced by LdrFindResource_U(), LdrFindResourceDirectory_U(), LdrpGetFileVersion(), LdrQueryApplicationCompatibilityGoo(), and RtlFindMessage().

00503 : 00504 00505 This function locates the address of the specified resource in the 00506 specified DLL and returns its address. 00507 00508 Arguments: 00509 00510 DllHandle - Supplies a handle to the image file that the resource is 00511 contained in. 00512 00513 ResourceIdPath - Supplies a pointer to an array of 32-bit resource 00514 identifiers. Each identifier is either an integer or a pointer 00515 to a null terminated string (PSZ) that specifies a resource 00516 name. The array is used to traverse the directory structure 00517 contained in the resource section in the image file specified by 00518 the DllHandle parameter. 00519 00520 ResourceIdPathLength - Supplies the number of elements in the 00521 ResourceIdPath array. 00522 00523 FindDirectoryEntry - Supplies a boolean that is TRUE if caller is 00524 searching for a resource directory, otherwise the caller is 00525 searching for a resource data entry. 00526 00527 ExactLangMatchOnly - Supplies a boolean that is TRUE if caller is 00528 searching for a resource with, and only with, the language id 00529 specified in ResourceIdPath, otherwise the caller wants the routine 00530 to come up with default when specified langid is not found. 00531 00532 ResourceDirectoryOrData - Supplies a pointer to a variable that will 00533 receive the address of the resource directory or data entry in 00534 the resource data section of the image file specified by the 00535 DllHandle parameter. 00536 00537 Return Value: 00538 00539 TBD 00540 00541 --*/ 00542 00543 { 00544 NTSTATUS Status; 00545 PIMAGE_RESOURCE_DIRECTORY LanguageResourceDirectory, ResourceDirectory, TopResourceDirectory; 00546 PIMAGE_RESOURCE_DIRECTORY_ENTRY ResourceDirEntLow; 00547 PIMAGE_RESOURCE_DIRECTORY_ENTRY ResourceDirEntMiddle; 00548 PIMAGE_RESOURCE_DIRECTORY_ENTRY ResourceDirEntHigh; 00549 PIMAGE_RESOURCE_DATA_ENTRY ResourceEntry; 00550 USHORT n, half; 00551 LONG dir; 00552 ULONG size; 00553 ULONG_PTR ResourceIdRetry; 00554 ULONG RetryCount; 00555 LANGID NewLangId; 00556 PULONG_PTR IdPath = ResourceIdPath; 00557 ULONG IdPathLength = ResourceIdPathLength; 00558 BOOLEAN fIsNeutral = FALSE; 00559 LANGID GivenLanguage; 00560 #ifndef NTOS_KERNEL_RUNTIME 00561 LCID DefaultThreadLocale, DefaultSystemLocale; 00562 PVOID AltResourceDllHandle = NULL; 00563 ULONG_PTR UIResourceIdPath[3]; 00564 #endif 00565 00566 RTL_PAGED_CODE(); 00567 00568 try { 00569 TopResourceDirectory = (PIMAGE_RESOURCE_DIRECTORY) 00570 RtlImageDirectoryEntryToData(DllHandle, 00571 TRUE, 00572 IMAGE_DIRECTORY_ENTRY_RESOURCE, 00573 &size 00574 ); 00575 if (!TopResourceDirectory) { 00576 return( STATUS_RESOURCE_DATA_NOT_FOUND ); 00577 } 00578 00579 ResourceDirectory = TopResourceDirectory; 00580 ResourceIdRetry = USE_FIRSTAVAILABLE_LANGID; 00581 RetryCount = 0; 00582 ResourceEntry = NULL; 00583 LanguageResourceDirectory = NULL; 00584 while (ResourceDirectory != NULL && ResourceIdPathLength--) { 00585 // 00586 // If search path includes a language id, then attempt to 00587 // match the following language ids in this order: 00588 // 00589 // (0) use given language id 00590 // (1) use primary language of given language id 00591 // (2) use id 0 (neutral resource) 00592 // (3) use default UI language id 00593 // 00594 // If the PRIMARY language id is ZERO, then ALSO attempt to 00595 // match the following language ids in this order: 00596 // 00597 // (4) use lang id of TEB if different from user locale 00598 // (5) use UI lang from exe resource 00599 // (6) use primary UI lang from exe resource 00600 // (7) use Install Language 00601 // (8) use lang id from user's locale id 00602 // (9) use primary language of user's locale id 00603 // (10) use lang id from system default locale id 00604 // (11) use primary language of system default locale id 00605 // (12) use US English lang id 00606 // (13) use any lang id that matches requested info 00607 // 00608 if (ResourceIdPathLength == 0 && IdPathLength == 3) { 00609 LanguageResourceDirectory = ResourceDirectory; 00610 } 00611 00612 if (LanguageResourceDirectory != NULL) { 00613 GivenLanguage = (LANGID)IdPath[ 2 ]; 00614 fIsNeutral = (PRIMARYLANGID( GivenLanguage ) == LANG_NEUTRAL); 00615 TryNextLangId: 00616 switch( RetryCount++ ) { 00617 #ifdef NTOS_KERNEL_RUNTIME 00618 case 0: // Use given language id 00619 NewLangId = GivenLanguage; 00620 break; 00621 00622 case 1: // Use primary language of given language id 00623 NewLangId = PRIMARYLANGID( GivenLanguage ); 00624 break; 00625 00626 case 2: // Use id 0 (neutral resource) 00627 NewLangId = 0; 00628 break; 00629 00630 case 3: // Use user's default UI language 00631 NewLangId = (LANGID)ResourceIdRetry; 00632 break; 00633 00634 case 4: // Use native UI language 00635 if ( !fIsNeutral ) { 00636 // Stop looking - Not in the neutral case 00637 goto ReturnFailure; 00638 break; 00639 } 00640 NewLangId = PsInstallUILanguageId; 00641 break; 00642 00643 case 5: // Use default system locale 00644 NewLangId = LANGIDFROMLCID(PsDefaultSystemLocaleId); 00645 break; 00646 00647 case 6: 00648 // Use US English language 00649 NewLangId = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ); 00650 break; 00651 00652 case 7: // Take any lang id that matches 00653 NewLangId = USE_FIRSTAVAILABLE_LANGID; 00654 break; 00655 00656 #else 00657 case 0: // Use given language id 00658 NewLangId = GivenLanguage; 00659 break; 00660 00661 case 1: // Use primary language of given language id 00662 if ( ExactLangMatchOnly) { 00663 // 00664 // Did not find an exact language match. 00665 // Stop looking. 00666 // 00667 goto ReturnFailure; 00668 } 00669 NewLangId = PRIMARYLANGID( GivenLanguage ); 00670 break; 00671 00672 case 2: // Use id 0 (neutral resource) 00673 NewLangId = 0; 00674 break; 00675 00676 case 3: // Use user's default UI language 00677 00678 if (!UILangId){ 00679 Status = NtQueryDefaultUILanguage( &UILangId ); 00680 if (!NT_SUCCESS( Status )) { 00681 // 00682 // Failed reading key. Skip this lookup. 00683 // 00684 NewLangId = (LANGID)ResourceIdRetry; 00685 break; 00686 } 00687 } 00688 NewLangId = UILangId; 00689 // 00690 // Arabic/Hebrew MUI files may contain resources with LANG ID different than 401/40d. 00691 // e.g. Comdlg32.dll has two sets of Arabic/Hebrew resources one mirrored (401/40d) 00692 // and one flipped (801/80d). 00693 // 00694 if( !fIsNeutral && 00695 ((PRIMARYLANGID (GivenLanguage) == LANG_ARABIC) || (PRIMARYLANGID (GivenLanguage) == LANG_HEBREW)) && 00696 (PRIMARYLANGID (GivenLanguage) == PRIMARYLANGID (NewLangId)) 00697 ) { 00698 NewLangId = GivenLanguage; 00699 } 00700 00701 if (fIsNeutral || GivenLanguage == NewLangId){ 00702 // 00703 // Load alternate resource dll. 00704 // 00705 AltResourceDllHandle=LdrLoadAlternateResourceModule( 00706 DllHandle, 00707 NULL); 00708 00709 if (!AltResourceDllHandle){ 00710 // 00711 // Alternate resource dll not available. 00712 // Skip this lookup. 00713 // 00714 NewLangId = (LANGID)ResourceIdRetry; 00715 break; 00716 00717 } 00718 00719 // 00720 // Map to alternate resource dll and search 00721 // it instead. 00722 // 00723 00724 UIResourceIdPath[0]=IdPath[0]; 00725 UIResourceIdPath[1]=IdPath[1]; 00726 UIResourceIdPath[2]=NewLangId; 00727 00728 Status = LdrpSearchResourceSection_U( 00729 AltResourceDllHandle, 00730 UIResourceIdPath, 00731 3, 00732 FindDirectoryEntry, 00733 TRUE, 00734 (PVOID *)ResourceDirectoryOrData 00735 ); 00736 00737 if (NT_SUCCESS(Status)){ 00738 // 00739 // We sucessfully found alternate resource, 00740 // return it. 00741 // 00742 return Status; 00743 } 00744 00745 00746 } 00747 // 00748 // Caller does not want alternate resource, or 00749 // alternate resource not found. 00750 // 00751 NewLangId = (LANGID)ResourceIdRetry; 00752 break; 00753 00754 00755 case 4: // Use langid of ThreadLocale if different from user locale 00756 if ( !fIsNeutral ) { 00757 // Stop looking - Not in the neutral case 00758 goto ReturnFailure; 00759 break; 00760 } 00761 00762 // 00763 // Try the thread locale language-id if it is different from 00764 // user locale. 00765 // 00766 if (NtCurrentTeb()){ 00767 Status = NtQueryDefaultLocale( 00768 TRUE, 00769 &DefaultThreadLocale 00770 ); 00771 if (NT_SUCCESS( Status ) && 00772 DefaultThreadLocale != 00773 NtCurrentTeb()->CurrentLocale) { 00774 // 00775 // Thread locale is different from 00776 // default locale. 00777 // 00778 NewLangId = LANGIDFROMLCID(NtCurrentTeb()->CurrentLocale); 00779 break; 00780 } 00781 } 00782 00783 NewLangId = (LANGID)ResourceIdRetry; 00784 break; 00785 00786 00787 case 5: // UI language from the executable resource 00788 00789 if (!UILangId){ 00790 NewLangId = (LANGID)ResourceIdRetry; 00791 } else { 00792 NewLangId = UILangId; 00793 } 00794 break; 00795 00796 case 6: // Parimary lang of UI language from the executable resource 00797 00798 if (!UILangId){ 00799 NewLangId = (LANGID)ResourceIdRetry; 00800 } else { 00801 NewLangId = PRIMARYLANGID( (LANGID) UILangId ); 00802 } 00803 break; 00804 00805 case 7: // Use install -native- language 00806 // 00807 // Thread locale is the same as the user locale, then let's 00808 // try loading the native (install) ui language resources. 00809 // 00810 if (!InstallLangId){ 00811 Status = NtQueryInstallUILanguage(&InstallLangId); 00812 if (!NT_SUCCESS( Status )) { 00813 // 00814 // Failed reading key. Skip this lookup. 00815 // 00816 NewLangId = (LANGID)ResourceIdRetry; 00817 break; 00818 00819 } 00820 } 00821 00822 NewLangId = InstallLangId; 00823 break; 00824 00825 case 8: // Use lang id from locale in TEB 00826 if (SUBLANGID( GivenLanguage ) == SUBLANG_SYS_DEFAULT) { 00827 // Skip over all USER locale options 00828 DefaultThreadLocale = 0; 00829 RetryCount += 2; 00830 break; 00831 } 00832 00833 if (NtCurrentTeb() != NULL) { 00834 NewLangId = LANGIDFROMLCID(NtCurrentTeb()->CurrentLocale); 00835 } 00836 break; 00837 00838 case 9: // Use User's default locale 00839 Status = NtQueryDefaultLocale( TRUE, &DefaultThreadLocale ); 00840 if (NT_SUCCESS( Status )) { 00841 NewLangId = LANGIDFROMLCID(DefaultThreadLocale); 00842 break; 00843 } 00844 00845 RetryCount++; 00846 break; 00847 00848 case 10: // Use primary language of User's default locale 00849 NewLangId = PRIMARYLANGID( (LANGID)ResourceIdRetry ); 00850 break; 00851 00852 case 11: // Use System default locale 00853 Status = NtQueryDefaultLocale( FALSE, &DefaultSystemLocale ); 00854 if (!NT_SUCCESS( Status )) { 00855 RetryCount++; 00856 break; 00857 } 00858 if (DefaultSystemLocale != DefaultThreadLocale) { 00859 NewLangId = LANGIDFROMLCID(DefaultSystemLocale); 00860 break; 00861 } 00862 00863 RetryCount += 2; 00864 // fall through 00865 00866 case 13: // Use US English language 00867 NewLangId = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ); 00868 break; 00869 00870 case 12: // Use primary language of System default locale 00871 NewLangId = PRIMARYLANGID( (LANGID)ResourceIdRetry ); 00872 break; 00873 00874 case 14: // Take any lang id that matches 00875 NewLangId = USE_FIRSTAVAILABLE_LANGID; 00876 break; 00877 #endif 00878 default: // No lang ids to match 00879 goto ReturnFailure; 00880 break; 00881 } 00882 00883 // 00884 // If looking for a specific language id and same as the 00885 // one we just looked up, then skip it. 00886 // 00887 if (NewLangId != USE_FIRSTAVAILABLE_LANGID && 00888 NewLangId == ResourceIdRetry 00889 ) { 00890 goto TryNextLangId; 00891 } 00892 00893 // 00894 // Try this new language Id 00895 // 00896 ResourceIdRetry = (ULONG_PTR)NewLangId; 00897 ResourceIdPath = &ResourceIdRetry; 00898 ResourceDirectory = LanguageResourceDirectory; 00899 } 00900 00901 n = ResourceDirectory->NumberOfNamedEntries; 00902 ResourceDirEntLow = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)(ResourceDirectory+1); 00903 if (!(*ResourceIdPath & LDR_RESOURCE_ID_NAME_MASK)) { 00904 ResourceDirEntLow += n; 00905 n = ResourceDirectory->NumberOfIdEntries; 00906 } 00907 00908 if (!n) { 00909 ResourceDirectory = NULL; 00910 goto NotFound; 00911 } 00912 00913 if (LanguageResourceDirectory != NULL && 00914 *ResourceIdPath == USE_FIRSTAVAILABLE_LANGID 00915 ) { 00916 ResourceDirectory = NULL; 00917 ResourceIdRetry = ResourceDirEntLow->Name; 00918 ResourceEntry = (PIMAGE_RESOURCE_DATA_ENTRY) 00919 ((PCHAR)TopResourceDirectory + 00920 ResourceDirEntLow->OffsetToData 00921 ); 00922 00923 break; 00924 } 00925 00926 ResourceDirectory = NULL; 00927 ResourceDirEntHigh = ResourceDirEntLow + n - 1; 00928 while (ResourceDirEntLow <= ResourceDirEntHigh) { 00929 if ((half = (n >> 1)) != 0) { 00930 ResourceDirEntMiddle = ResourceDirEntLow; 00931 if (*(PUCHAR)&n & 1) { 00932 ResourceDirEntMiddle += half; 00933 } 00934 else { 00935 ResourceDirEntMiddle += half - 1; 00936 } 00937 dir = LdrpCompareResourceNames_U( *ResourceIdPath, 00938 TopResourceDirectory, 00939 ResourceDirEntMiddle 00940 ); 00941 if (!dir) { 00942 if (ResourceDirEntMiddle->DataIsDirectory) { 00943 ResourceDirectory = (PIMAGE_RESOURCE_DIRECTORY) 00944 ((PCHAR)TopResourceDirectory + 00945 ResourceDirEntMiddle->OffsetToDirectory 00946 ); 00947 } 00948 else { 00949 ResourceDirectory = NULL; 00950 ResourceEntry = (PIMAGE_RESOURCE_DATA_ENTRY) 00951 ((PCHAR)TopResourceDirectory + 00952 ResourceDirEntMiddle->OffsetToData 00953 ); 00954 } 00955 00956 break; 00957 } 00958 else { 00959 if (dir < 0) { 00960 ResourceDirEntHigh = ResourceDirEntMiddle - 1; 00961 if (*(PUCHAR)&n & 1) { 00962 n = half; 00963 } 00964 else { 00965 n = half - 1; 00966 } 00967 } 00968 else { 00969 ResourceDirEntLow = ResourceDirEntMiddle + 1; 00970 n = half; 00971 } 00972 } 00973 } 00974 else { 00975 if (n != 0) { 00976 dir = LdrpCompareResourceNames_U( *ResourceIdPath, 00977 TopResourceDirectory, 00978 ResourceDirEntLow 00979 ); 00980 if (!dir) { 00981 if (ResourceDirEntLow->DataIsDirectory) { 00982 ResourceDirectory = (PIMAGE_RESOURCE_DIRECTORY) 00983 ((PCHAR)TopResourceDirectory + 00984 ResourceDirEntLow->OffsetToDirectory 00985 ); 00986 } 00987 else { 00988 ResourceEntry = (PIMAGE_RESOURCE_DATA_ENTRY) 00989 ((PCHAR)TopResourceDirectory + 00990 ResourceDirEntLow->OffsetToData 00991 ); 00992 } 00993 } 00994 } 00995 00996 break; 00997 } 00998 } 00999 01000 ResourceIdPath++; 01001 } 01002 01003 if (ResourceEntry != NULL && !FindDirectoryEntry) { 01004 *ResourceDirectoryOrData = (PVOID)ResourceEntry; 01005 Status = STATUS_SUCCESS; 01006 } 01007 else 01008 if (ResourceDirectory != NULL && FindDirectoryEntry) { 01009 *ResourceDirectoryOrData = (PVOID)ResourceDirectory; 01010 Status = STATUS_SUCCESS; 01011 } 01012 else { 01013 NotFound: 01014 switch( IdPathLength - ResourceIdPathLength) { 01015 case 3: Status = STATUS_RESOURCE_LANG_NOT_FOUND; break; 01016 case 2: Status = STATUS_RESOURCE_NAME_NOT_FOUND; break; 01017 case 1: Status = STATUS_RESOURCE_TYPE_NOT_FOUND; break; 01018 default: Status = STATUS_INVALID_PARAMETER; break; 01019 } 01020 } 01021 01022 if (Status == STATUS_RESOURCE_LANG_NOT_FOUND && 01023 LanguageResourceDirectory != NULL 01024 ) { 01025 ResourceEntry = NULL; 01026 goto TryNextLangId; 01027 ReturnFailure: ; 01028 Status = STATUS_RESOURCE_LANG_NOT_FOUND; 01029 } 01030 } 01031 except (EXCEPTION_EXECUTE_HANDLER) { 01032 Status = GetExceptionCode(); 01033 } 01034 01035 return Status; 01036 }

BOOLEAN LdrpSetAlternateResourceModuleHandle IN PVOID  Module,
IN PVOID  AlternateModule
 

Definition at line 1492 of file ldrrsrc.c.

References _ALT_RESOURCE_MODULE::AlternateModule, AlternateResourceModuleCount, AlternateResourceModules, AltResMemBlockCount, FALSE, MEMBLOCKSIZE, _ALT_RESOURCE_MODULE::ModuleBase, NULL, RESMODSIZE, RtlAllocateHeap, RtlReAllocateHeap(), and TRUE.

Referenced by LdrLoadAlternateResourceModule().

01499 : 01500 01501 This function records the handle of the base module and alternate 01502 resource module in an array. 01503 01504 Arguments: 01505 01506 Module - The handle of the base module. 01507 AlternateModule - The handle of the alternate resource module 01508 01509 Return Value: 01510 01511 TBD. 01512 01513 --*/ 01514 01515 { 01516 PALT_RESOURCE_MODULE NewModules; 01517 01518 if (AlternateResourceModules == NULL){ 01519 // 01520 // Allocate memory of initial size MEMBLOCKSIZE. 01521 // 01522 NewModules = RtlAllocateHeap( 01523 RtlProcessHeap(), 01524 HEAP_ZERO_MEMORY, 01525 RESMODSIZE * MEMBLOCKSIZE); 01526 if (!NewModules){ 01527 return FALSE; 01528 } 01529 AlternateResourceModules = NewModules; 01530 AltResMemBlockCount = MEMBLOCKSIZE; 01531 } 01532 else 01533 if (AlternateResourceModuleCount >= AltResMemBlockCount ){ 01534 // 01535 // ReAllocate another chunk of memory. 01536 // 01537 NewModules = RtlReAllocateHeap( 01538 RtlProcessHeap(), 01539 0, 01540 AlternateResourceModules, 01541 (AltResMemBlockCount + MEMBLOCKSIZE) * RESMODSIZE 01542 ); 01543 01544 if (!NewModules){ 01545 return FALSE; 01546 } 01547 AlternateResourceModules = NewModules; 01548 AltResMemBlockCount += MEMBLOCKSIZE; 01549 } 01550 01551 AlternateResourceModules[AlternateResourceModuleCount].ModuleBase = Module; 01552 AlternateResourceModules[AlternateResourceModuleCount].AlternateModule = AlternateModule; 01553 01554 01555 01556 AlternateResourceModuleCount++; 01557 01558 return TRUE; 01559 01560 }

BOOLEAN LdrpVerifyAlternateResourceModule IN PVOID  Module,
IN PVOID  AlternateModule
 

Definition at line 1427 of file ldrrsrc.c.

References FALSE, InstallLangId, LdrpGetFileVersion(), NT_SUCCESS, NtQueryDefaultUILanguage(), NtQueryInstallUILanguage(), NTSTATUS(), Status, TRUE, and UILangId.

01434 : 01435 01436 This function verifies if the alternate resource module has the same 01437 version of the base module. 01438 01439 Arguments: 01440 01441 Module - The handle of the base module. 01442 AlternateModule - The handle of the alternate resource module 01443 01444 Return Value: 01445 01446 TBD. 01447 01448 --*/ 01449 01450 { 01451 ULONGLONG ModuleVersion; 01452 ULONGLONG AltModuleVersion; 01453 NTSTATUS Status; 01454 01455 if (!UILangId){ 01456 Status = NtQueryDefaultUILanguage( &UILangId); 01457 if (!NT_SUCCESS( Status )) { 01458 // 01459 // Failed to get UI LangID. AltResource not enabled. 01460 // 01461 return FALSE; 01462 } 01463 } 01464 01465 if (!LdrpGetFileVersion(AlternateModule, UILangId, &AltModuleVersion)){ 01466 return FALSE; 01467 } 01468 01469 if (!InstallLangId){ 01470 Status = NtQueryInstallUILanguage (&InstallLangId); 01471 if (!NT_SUCCESS( Status )) { 01472 // 01473 // Failed to get Install LangID. AltResource not enabled. 01474 // 01475 return FALSE; 01476 } 01477 } 01478 01479 if (!LdrpGetFileVersion(Module, InstallLangId, &ModuleVersion)){ 01480 return FALSE; 01481 } 01482 01483 if (ModuleVersion == AltModuleVersion){ 01484 return TRUE; 01485 } 01486 else{ 01487 return FALSE; 01488 } 01489 }

NTSTATUS RtlCompressBufferLZNT1 IN USHORT  CompressionEngine,
IN PUCHAR  UncompressedBuffer,
IN ULONG  UncompressedBufferSize,
OUT PUCHAR  CompressedBuffer,
IN ULONG  CompressedBufferSize,
IN ULONG  UncompressedChunkSize,
OUT PULONG  FinalCompressedSize,
IN PVOID  WorkSpace
 

NTSTATUS RtlCompressWorkSpaceSizeLZNT1 IN USHORT  CompressionEngine,
OUT PULONG  CompressBufferWorkSpaceSize,
OUT PULONG  CompressFragmentWorkSpaceSize
 

NTSTATUS RtlDecompressBufferLZNT1 OUT PUCHAR  UncompressedBuffer,
IN ULONG  UncompressedBufferSize,
IN PUCHAR  CompressedBuffer,
IN ULONG  CompressedBufferSize,
OUT PULONG  FinalUncompressedSize
 

NTSTATUS RtlDecompressFragmentLZNT1 OUT PUCHAR  UncompressedFragment,
IN ULONG  UncompressedFragmentSize,
IN PUCHAR  CompressedBuffer,
IN ULONG  CompressedBufferSize,
IN ULONG  FragmentOffset,
OUT PULONG  FinalUncompressedSize,
IN PVOID  WorkSpace
 

NTSTATUS RtlDescribeChunkLZNT1 IN OUT PUCHAR *  CompressedBuffer,
IN PUCHAR  EndOfCompressedBufferPlus1,
OUT PUCHAR *  ChunkBuffer,
OUT PULONG  ChunkSize
 

VOID RtlpAnsiPszToUnicodePsz IN PCHAR  AnsiString,
IN WCHAR *  UnicodeString,
IN USHORT  AnsiStringLength
 

Definition at line 69 of file nlssup.c.

References Index, and RtlAnsiCharToUnicodeChar().

00077 : 00078 00079 This function translates the specified ansi character to unicode and 00080 returns the unicode value. The purpose for this routine is to allow 00081 for character by character ansi to unicode translation. The 00082 translation is done with respect to the current system locale 00083 information. 00084 00085 00086 Arguments: 00087 00088 AnsiString - Supplies a pointer to the ANSI string to convert to unicode. 00089 UnicodeString - Supplies a pointer to a buffer to hold the unicode string 00090 AnsiStringLength - Supplies the length of the ANSI string. 00091 00092 Return Value: 00093 00094 None. 00095 00096 --*/ 00097 00098 { 00099 ULONG Index; 00100 PCHAR AnsiChar; 00101 00102 AnsiChar = AnsiString; 00103 Index = 0; 00104 while(Index < AnsiStringLength ) { 00105 UnicodeString[Index] = RtlAnsiCharToUnicodeChar(&AnsiChar); 00106 Index++; 00107 } 00108 UnicodeString[Index] = UNICODE_NULL; 00109 } }

BOOLEAN RtlpDidUnicodeToOemWork IN POEM_STRING  OemString,
IN PUNICODE_STRING  UnicodeString
 

Definition at line 1665 of file nlsxlat.c.

References ASSERT, FALSE, NlsMbOemCodePageTag, NlsOemLeadByteInfo, OemDefaultChar, OemTransUniDefaultChar, RTL_PAGED_CODE, TRUE, and USHORT.

Referenced by RtlDnsHostNameToComputerName(), RtlUnicodeStringToCountedOemString(), RtlUpcaseUnicodeStringToCountedOemString(), and RtlUpcaseUnicodeStringToOemString().

01672 : 01673 01674 This function looks for the default character in the Oem string, making 01675 sure it was not a correct translation from the Unicode source string. 01676 01677 This allows us to test whether or not a translation was really successful. 01678 01679 Arguments: 01680 01681 OemString - The result of conversion from the unicode string. 01682 01683 UnicodeString - The source of the Oem string. 01684 01685 Return Value: 01686 01687 TRUE if the Unicode to Oem translation caused no default characters to be 01688 inserted. FALSE otherwise. 01689 01690 --*/ 01691 01692 { 01693 ULONG OemOffset; 01694 BOOLEAN Result = TRUE; 01695 01696 RTL_PAGED_CODE(); 01697 01698 if (!NlsMbOemCodePageTag) { 01699 01700 for (OemOffset = 0; 01701 OemOffset < OemString->Length; 01702 OemOffset += 1) { 01703 01704 if ((OemString->Buffer[OemOffset] == (UCHAR)OemDefaultChar) && 01705 (UnicodeString->Buffer[OemOffset] != OemTransUniDefaultChar)) { 01706 01707 Result = FALSE; 01708 break; 01709 } 01710 } 01711 01712 } else { 01713 01714 ULONG UnicodeOffset; 01715 01716 for (OemOffset = 0, UnicodeOffset = 0; 01717 OemOffset < OemString->Length; 01718 OemOffset += 1, UnicodeOffset += 1) { 01719 01720 // 01721 // If we landed on a DBCS character handle it accordingly 01722 // 01723 01724 if (NlsOemLeadByteInfo[(UCHAR)OemString->Buffer[OemOffset]]) { 01725 01726 USHORT DbcsChar; 01727 01728 ASSERT( OemOffset + 1 < OemString->Length ); 01729 01730 DbcsChar = (OemString->Buffer[OemOffset] << 8) + (UCHAR)OemString->Buffer[OemOffset+1]; 01731 OemOffset++; 01732 01733 if ((DbcsChar == OemDefaultChar) && 01734 (UnicodeString->Buffer[UnicodeOffset] != OemTransUniDefaultChar)) { 01735 01736 Result = FALSE; 01737 break; 01738 } 01739 01740 continue; 01741 } 01742 01743 if ((OemString->Buffer[OemOffset] == (UCHAR)OemDefaultChar) && 01744 (UnicodeString->Buffer[UnicodeOffset] != OemTransUniDefaultChar)) { 01745 01746 Result = FALSE; 01747 break; 01748 } 01749 } 01750 } 01751 01752 return Result; 01753 }

VOID RtlpGetStackLimits OUT PULONG_PTR  LowLimit,
OUT PULONG_PTR  HighLimit
 

Definition at line 126 of file rtl/ia64/miscc.c.

Referenced by RtlDispatchException(), RtlGetCallersAddress(), RtlUnwind(), RtlUnwind2(), RtlUnwindReturn(), and RtlUnwindRfp().

00133 : 00134 00135 This function returns the current memory stack limits based on the 00136 current processor mode. 00137 00138 Arguments: 00139 00140 LowStackLimit - Supplies a pointer to a variable that is to receive 00141 the low limit of the memory stack. 00142 00143 HighStackLimit - Supplies a pointer to a variable that is to receive 00144 the high limit of the memory stack. 00145 00146 Return Value: 00147 00148 None. 00149 00150 --*/ 00151 00152 { 00153 00154 #if defined(NTOS_KERNEL_RUNTIME) 00155 00156 // 00157 // Kernel Mode 00158 // 00159 00160 *HighStackLimit = (ULONG_PTR)PCR->InitialStack; 00161 *LowStackLimit = (ULONG_PTR)PCR->StackLimit; 00162 00163 #else 00164 00165 // 00166 // User Mode 00167 // 00168 00169 PTEB CurrentTeb = NtCurrentTeb(); 00170 00171 *HighStackLimit = (ULONG_PTR)CurrentTeb->NtTib.StackBase; 00172 *LowStackLimit = (ULONG_PTR)CurrentTeb->NtTib.StackLimit; 00173 00174 #endif // defined(NTOS_KERNEL_RUNTIME) 00175 }

PVOID FASTCALL RtlpInterlockedPopEntrySList IN PSLIST_HEADER  ListHead  ) 
 

Referenced by RtlpAllocateFromHeapLookaside().

PVOID FASTCALL RtlpInterlockedPushEntrySList IN PSLIST_HEADER  ListHead,
IN PVOID  ListEntry
 

Referenced by RtlpFreeToHeapLookaside().

ULONG RtlpLogExceptionHandler IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  ContextRecord,
IN ULONG_PTR  ControlPc,
IN PVOID  HandlerData,
IN ULONG  Size
 

Definition at line 65 of file excptdbg.c.

References ASSERT, RtlpExceptionLog, RtlpExceptionLogCount, and Size.

Referenced by RtlDispatchException().

00074 : 00075 00076 Records the dispatching of exceptions to frame-based handlers. 00077 The debugger may inspect the table later and interpret the data 00078 to discover the address of the filters and handlers. 00079 00080 Arguments: 00081 00082 ExceptionRecord - Supplies an exception record 00083 00084 ContextRecord - Supplies the context at the exception 00085 00086 ControlPc - Supplies the PC where control left the frame being 00087 dispatched to. 00088 00089 HandlerData - Supplies a pointer to the host-dependent exception 00090 data. On the RISC machines this is a RUNTIME_FUNCTION record; 00091 on x86 it is the registration record from the stack frame. 00092 00093 Size - Supplies the size of HandlerData 00094 00095 Returns: 00096 00097 The index to the log entry used, so that if the handler returns 00098 a disposition it may be recorded. 00099 00100 --*/ 00101 { 00102 #if !defined(NTOS_KERNEL_RUNTIME) 00103 00104 return 0; 00105 00106 #else 00107 00108 ULONG LogIndex; 00109 00110 if (!RtlpExceptionLog) { 00111 return 0; 00112 } 00113 00114 ASSERT(Size <= MAX_EXCEPTION_LOG_DATA_SIZE * sizeof(ULONG)); 00115 00116 do { 00117 LogIndex = RtlpExceptionLogCount; 00118 } while (LogIndex != (ULONG)InterlockedCompareExchange( 00119 (PLONG)&RtlpExceptionLogCount, 00120 ((LogIndex + 1) % MAX_EXCEPTION_LOG), 00121 LogIndex)); 00122 00123 // 00124 // the debugger will have to interpret the exception handler 00125 // data, because it cannot be done safely here. 00126 // 00127 00128 RtlCopyMemory(RtlpExceptionLog[LogIndex].HandlerData, 00129 HandlerData, 00130 Size); 00131 RtlpExceptionLog[LogIndex].ExceptionRecord = *ExceptionRecord; 00132 RtlpExceptionLog[LogIndex].ContextRecord = *ContextRecord; 00133 RtlpExceptionLog[LogIndex].Disposition = -1; 00134 00135 return LogIndex; 00136 #endif // !NTOS_KERNEL_RUNTIME 00137 }

VOID RtlpLogLastExceptionDisposition IN ULONG  LogIndex,
IN EXCEPTION_DISPOSITION  Disposition
 

Referenced by RtlDispatchException().

NTSTATUS RtlReserveChunkLZNT1 IN OUT PUCHAR *  CompressedBuffer,
IN PUCHAR  EndOfCompressedBufferPlus1,
OUT PUCHAR *  ChunkBuffer,
IN ULONG  ChunkSize
 


Variable Documentation

PUSHORT Nls844UnicodeLowercaseTable
 

Definition at line 176 of file ntrtlp.h.

Referenced by RtlResetRtlTranslations().

PUSHORT Nls844UnicodeUpcaseTable
 

Definition at line 175 of file ntrtlp.h.

Referenced by RtlResetRtlTranslations().

CONST CCHAR RtlpBitsClearAnywhere[256]
 

Definition at line 134 of file ntrtlp.h.

Referenced by RtlFindClearBits(), and RtlFindClearRuns().

CONST CCHAR RtlpBitsClearHigh[256]
 

Definition at line 136 of file ntrtlp.h.

Referenced by RtlFindClearBits(), RtlFindClearRuns(), and RtlFindMostSignificantBit().

CONST CCHAR RtlpBitsClearLow[256]
 

Definition at line 135 of file ntrtlp.h.

Referenced by RtlFindClearBits(), RtlFindClearRuns(), and RtlFindLeastSignificantBit().

CONST CCHAR RtlpBitsClearTotal[256]
 

Definition at line 137 of file ntrtlp.h.

Referenced by RtlNumberOfClearBits().


Generated on Sat May 15 19:44:53 2004 for test by doxygen 1.3.7