CeGetTempPath

The CeGetTempPath function gets the path to the directory designated for temporary files.

Syntax

DWORD CeGetTempPath( DWORD nBufferLength, LPWSTR lpBuffer );

At a Glance

Header file: Rapi.h
Platforms: H/PC
Windows CE versions: 2.0 and later

Parameters

nBufferLength
Size of lpBuffer in characters.
lpBuffer
Address of the buffer for the folder path.

Return Values

The return value is the length, in characters, of the string copied to lpBuffer, not including the terminating null character. If the return value is greater than nBufferLength, the return value is the size of the buffer required to hold the path.

If CeGetTempPath fails, the return value is 0. To get extended error information, call CeGetLastError.

Remarks

The CeGetTempPath function gets the temporary file path as follows:

  1. The path specified by the TMP environment variable.
  2. The path specified by the TEMP environment variable, if TMP is not defined.
  3. The current directory, if both TMP and TEMP are not defined.