UniToBCSPath

UniToBCSPath(
 unsigned char * pBCSPath,
 ParsedPath * pUniPath,
 unsigned int maxLength,
 int charSet
 )
 

This service converts a canonicalized unicode pathname to a normal pathname in the specified BCS character set, that is, the path element lengths are converted into proper path separators in addition to the character set conversion. Currently, the Windows ANSI codepage or the current OEM codepage in the system can be specified for the conversion. It is important to note that the source and destination buffers cannot be the same nor can they overlap. They should be two separate buffers. This service does not terminate the converted path with a NUL character, the caller of the service needs to do this, if necessary.

pBCSPath
Supplies a flat pointer to a destination buffer for the converted BCS path.
pUniPath
Supplies a flat pointer to a canonicalized unicode pathname in the ParsedPath structure format that needs to be converted into a BCS path. The pointer should be pointing at the pp_elements field of the ParsedPath structure.
maxLength
Supplies the maximum length in bytes of the destination buffer, excluding the NUL character.
charSet
Supplies the BCS character set the unicode path needs to be converted to.
BCS Character Set Values:  
Value Meaning
BCS_WANSI Specifies that the conversion should be done to the Windows ANSI codepage.
BCS_OEM Specifies that the conversion should be done to currently active OEM codepage.

_QWORD Structure:

The fields in this structure are filled in as follows.

 
ddLower Returns the number of bytes in the converted unicode string. Under the standard C parameter conventions, this field is returned in register [EAX].
ddUpper Returns special flags about the mapping operation. Under the standard C parameter conventions, this field is returned in register [EDX].

Mapping Flag Values:  
Value Meaning
MAP_FLAG_LOSS Indicates that a loss occurred during the conversion. This will typically happen if the BCS character has no corresponding character in the unicode character set. The replacement character for this case is the underscore character "_", ASCII code 0x5f.
MAP_FLAG_TRUNCATE Indicates that the destination buffer was not large enough to contain the converted BCS path.

pBCSPath Filled in with the converted BCS path.