18#define Dbg (DEBUG_TRACE_NAMESUP)
21#pragma alloc_text(PAGE, Fat8dot3ToString)
22#pragma alloc_text(PAGE, FatIsNameInExpression)
23#pragma alloc_text(PAGE, FatStringTo8dot3)
24#pragma alloc_text(PAGE, FatSetFullFileNameInFcb)
25#pragma alloc_text(PAGE, FatGetUnicodeNameFromFcb)
26#pragma alloc_text(PAGE, FatUnicodeToUpcaseOem)
27#pragma alloc_text(PAGE, FatSelectNames)
28#pragma alloc_text(PAGE, FatEvaluateNameCase)
29#pragma alloc_text(PAGE, FatSpaceInName)
30#pragma alloc_text(PAGE, FatUnicodeRestoreShortNameCase)
128 (
i < (
ULONG)InputString.Length) && (InputString.Buffer[
i] !=
'.') && (
i < 11);
131 (*Output8dot3)[
i] = InputString.Buffer[
i];
138 if (
i < (
ULONG)InputString.Length) {
154 for (
j = 8; (
i < (
ULONG)InputString.Length);
j += 1,
i += 1) {
156 (*Output8dot3)[
j] = InputString.Buffer[
i];
165 if ((*Output8dot3)[0] == 0xe5) {
210 ULONG BaseLength, ExtensionLength;
220 for (BaseLength = 8; BaseLength > 0; BaseLength -= 1) {
232 for (ExtensionLength = 3; ExtensionLength > 0; ExtensionLength -= 1) {
245 if (BaseLength != 0) {
251 OutputString->Buffer[0] = 0xe5;
291 if (ExtensionLength != 0) {
299 OutputString->Buffer[BaseLength++] =
'.';
305 o = (
PUCHAR)&OutputString->Buffer[BaseLength];
308 switch (ExtensionLength) {
321 OutputString->Length = (
USHORT)(BaseLength + ExtensionLength);
362 OutputString->Length = (
USHORT)BaseLength;
369 DebugTrace(-1,
Dbg,
"Fat8dot3ToString, OutputString = \"%Z\" -> VOID\n", OutputString);
378FatGetUnicodeNameFromFcb (
428 FatLocateDirent( IrpContext,
445 if ((DirentBcb ==
NULL) ||
459 UCHAR ShortNameBuffer[12];
489#pragma prefast( suppress:28931, "needed for debug build" )
506FatSetFullFileNameInFcb (
598 while (TmpFcb != StopFcb) {
600 FatGetUnicodeNameFromFcb( IrpContext,
763 WCHAR ShortNameBuffer[12];
773 GenerateShortName =
TRUE;
775 TrySuggestedShortName = (SuggestedShortName !=
NULL);
781 ShortUnicodeName.
Length = 0;
783 ShortUnicodeName.
Buffer = ShortNameBuffer;
793 if (TrySuggestedShortName) {
800 ShortUnicodeName.
Length = SuggestedShortName->Length;
801 ShortUnicodeName.
MaximumLength = SuggestedShortName->MaximumLength;
802 ShortUnicodeName.
Buffer = SuggestedShortName->Buffer;
804 TrySuggestedShortName =
FALSE;
816#pragma prefast( suppress:28931, "needed for debug build" )
824 FatLocateSimpleOemDirent( IrpContext,
864 GenerateShortName =
FALSE;
871 if (GenerateShortName) {
940 if ((
c >=
'A') && (
c <=
'Z')) {
944 }
else if ((
c >=
'a') && (
c <=
'z')) {
960 *
CreateLfn = (Lowers != 0) && (Uppers != 0);
964 ExtensionPresent =
TRUE;
980 ((Lowers != 0) && (Uppers != 0)));
987 if (ExtensionPresent) {
1070 NT_ASSERT( ShortNameWithCase->Length <= 24 );
1076 for (
i = 0;
i < (ShortNameWithCase->Length/
sizeof(
WCHAR)) &&
1077 ShortNameWithCase->Buffer[
i] !=
L'.';
i++);
1085 DownCaseSeg.
Buffer = ShortNameWithCase->Buffer;
1104 if ((
i*
sizeof(
WCHAR)) < ShortNameWithCase->Length) {
1105 DownCaseSeg.
Buffer = &ShortNameWithCase->Buffer[
i];
NTSYSAPI VOID NTAPI RtlGenerate8dot3Name(_In_ PCUNICODE_STRING Name, _In_ BOOLEAN AllowExtendedCharacters, _Inout_ PGENERATE_NAME_CONTEXT Context, _Inout_ PUNICODE_STRING Name8dot3)
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT _Inout_ PDIRENT Dirent
#define _Requires_lock_held_(lock)
BOOLEAN NTAPI FsRtlIsDbcsInExpression(IN PANSI_STRING Expression, IN PANSI_STRING Name)
#define NT_SUCCESS(StatCode)
#define FsRtlIsLeadDbcsCharacter(DBCS_CHAR)
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG DirentByteOffset
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING Lfn
#define FAT_DIRENT_NT_BYTE_8_LOWER_CASE
#define FAT_DIRENT_REALLY_0E5
#define FAT_DIRENT_NT_BYTE_3_LOWER_CASE
#define MAX_LFN_CHARACTERS
#define TAG_FILENAME_BUFFER
VOID FatUnicodeRestoreShortNameCase(IN PUNICODE_STRING ShortNameWithCase, IN BOOLEAN LowerCase8, IN BOOLEAN LowerCase3)
VOID FatUnicodeToUpcaseOem(IN PIRP_CONTEXT IrpContext, IN POEM_STRING OemString, IN PUNICODE_STRING UnicodeString)
VOID FatStringTo8dot3(_In_ PIRP_CONTEXT IrpContext, _In_ OEM_STRING InputString, _Out_writes_bytes_(11) PFAT8DOT3 Output8dot3)
BOOLEAN FatSpaceInName(IN PIRP_CONTEXT IrpContext, IN PUNICODE_STRING UnicodeName)
BOOLEAN FatIsNameInExpression(IN PIRP_CONTEXT IrpContext, IN OEM_STRING Expression, IN OEM_STRING Name)
VOID Fat8dot3ToString(_In_ PIRP_CONTEXT IrpContext, _In_ PDIRENT Dirent, _In_ BOOLEAN RestoreCase, _Out_ POEM_STRING OutputString)
VOID FatEvaluateNameCase(IN PIRP_CONTEXT IrpContext, IN PUNICODE_STRING UnicodeName, IN OUT BOOLEAN *AllLowerComponent, IN OUT BOOLEAN *AllLowerExtension, IN OUT BOOLEAN *CreateLfn)
#define DebugTrace(INDENT, LEVEL, X, Y)
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
#define FatUnpinBcb(IRPCONTEXT, BCB)
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING IN PUNICODE_STRING SuggestedShortName IN OUT BOOLEAN IN OUT BOOLEAN IN OUT BOOLEAN * CreateLfn
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING IN PUNICODE_STRING SuggestedShortName IN OUT BOOLEAN * AllLowerComponent
IN PDCB IN POEM_STRING IN PUNICODE_STRING UnicodeName
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING ShortName
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING IN PUNICODE_STRING SuggestedShortName IN OUT BOOLEAN IN OUT BOOLEAN * AllLowerExtension
#define FatIsNameShortOemValid(IRPCONTEXT, NAME, CAN_CONTAIN_WILD_CARDS, PATH_NAME_OK, LEADING_BACKSLASH_OK)
#define FatNormalizeAndRaiseStatus(IRPCONTEXT, STATUS)
#define FatRaiseStatus(IRPCONTEXT, STATUS)
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
IN PDCB IN POEM_STRING OemName
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define RtlFillMemory(Dest, Length, Fill)
NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING *, const UNICODE_STRING *, BOOLEAN)
NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING *, const UNICODE_STRING *, BOOLEAN)
#define _Out_writes_bytes_(size)
#define _Analysis_assume_(expr)
#define UNREFERENCED_PARAMETER(P)
PVOID NTAPI FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes, IN ULONG Tag)
#define STATUS_FILE_INVALID
#define STATUS_UNMAPPABLE_CHARACTER
#define _SEH2_AbnormalTermination()
NTSTATUS NTAPI RtlOemStringToCountedUnicodeString(IN OUT PUNICODE_STRING UniDest, IN PCOEM_STRING OemSource, IN BOOLEAN AllocateDestinationString)
#define STATUS_BUFFER_OVERFLOW
PULONG MinorVersion OPTIONAL
union _CCB::@733::@735::@737 OemQueryTemplate
UNICODE_STRING UnicodeQueryTemplate
BOOLEAN ContainsWildCards
BOOLEAN CodePageInvariant
VBO LfnOffsetWithinDirectory
UNICODE_STRING FullFileName
VBO DirentOffsetWithinDirectory
union _FILE_NAME_NODE::@728 Name
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR StringIndex
*BytesInOemString PCHAR OemString