CheckNameLegalDOS8Dot3A function

Determines whether the specified name can be used to create a file on a FAT file system.

Syntax

BOOL CheckNameLegalDOS8Dot3A(
  LPCSTR                     lpName,
  LPSTR                      lpOemName,
  DWORD                      OemNameSize,
  PBOOL pbNameContainsSpaces OPTIONAL,
  PBOOL                      pbNameLegal
);

Parameters

lpName

The file name, in 8.3 format.

lpOemName

A pointer to a buffer that receives the OEM string that corresponds to Name. This parameter can be NULL.

OemNameSize

The size of the lpOemName buffer, in characters. If lpOemName is NULL, this parameter must be 0 (zero).

OPTIONAL

pbNameLegal

If the function succeeds, this parameter indicates whether a file name is a valid 8.3 FAT file name when the current OEM code page is applied to the file name.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is 0 (zero). To get extended error information, call GetLastError.

Remarks

This function can be used to determine whether or not a file name can be passed to a 16-bit Windows-based application or an MS-DOS-based application.

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

Technology Supported
Server Message Block (SMB) 3.0 protocol Yes
SMB 3.0 Transparent Failover (TFO) See remarks
SMB 3.0 with Scale-out File Shares (SO) See remarks
Cluster Shared Volume File System (CsvFS) Yes
Resilient File System (ReFS) Yes
 

Note that SMB 3.0 does not support short names on shares with continuous availability capability, so function will always return zero (fail).

Requirements

   
Windows version Windows Vista, Windows XP with SP1 [desktop apps only] Windows Server 2003 [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

File Management Functions

GetOEMCP