CreateBasis

CreateBasis(
 string_t pBasisName,
 string_t pUniName,
 unsigned int length
 )
 

This service maps a long name format case-preserved unicode name into an uppercased "basis" name which is also in unicode but in the FCB-format, that is, it has a "primary" name with 8 characters and a 3-character "extension" immediately following it with no intervening dot character. For this service, the source and destination buffers must be different.

The following rules are used to create the basis name:

  1. Leading dots and trailing dots are ignored in generating the basis name.
  2. Embedded whitespace characters are ignored in generating the basis name.
  3. The first three non-whitespace characters after the last embedded dot in the name form the 'extension'.
  4. The first 8 characters of the name form the 'primary' name. If there are dot characters before the first 8 characters (excluding leading dots), then the 'primary' name is that part of the name until the first dot character is hit.
  5. The long name syntax allows for certain special characters which are not allowed in the old DOS syntax. These characters are all replaced by an "_" character. In addition, any unicode character which is part of the newly formed basis name but is not translatable in the current OEM codepage is replaced by an "_" character.
pBasisName
Supplies a flat pointer to the buffer the basis name is to be returned in. This buffer must be at least 22 bytes long.
pUniName
Supplies a flat pointer to the unicode name from which the basis name needs to be generated.
length
Supplies the length in bytes of the unicode input name.
Mapping Flag Values:  
Value Meaning
BASIS_LOSS Indicates that either a unicode character in the input long-name could not be mapped into a corresponding unicode character in the OEM codepage or there were characters in the long name not allowed in the basis name. In both cases, the "_" is the replacement character.
BASIS_UPCASE Indicates that a unicode character in the long-name had to be upcased for the basis name.
BASIS_TRUNC Indicates that the input name did not fit into the standard DOS 8.3 style name. Either the primary name, extension or other components allowed in the long name were truncated during the mapping process. The output basis name is valid, but a truncated form of the long name passed in.
BASIS_EXT Indicates that the created basis name has an extended character in it, that is, a character whose OEM Codepoint value is greater than 0x80. This extended character is, however, translatable in the current OEM codepage.

pBasisName Returns the generated basis name in this buffer.