Share via


CeFindFirstFile (RAPI)

This function searches a directory for a file whose name matches the specified filename. CeFindFirstFile examines subdirectory names as well as filenames.

CeFindFirstFile is a remote application interface (RAPI), which enables an application running on a desktop computer to make function calls on a Windows CE–based device.

HANDLE CeFindFirstFile(
LPCWSTR lpFileName, 
LPCE_FIND_DATA lpFindFileData); 

Parameters

  • lpFileName
    [in] Long pointer to a null-terminated string that specifies a valid directory or path and filename, which can contain wildcard characters (* and ?).

    There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the FindFirstFile function parses paths. An application can transcend this limit and send in paths longer than MAX_PATH characters prepending "\\?\" to the path. The "\\?\" tells the function to turn off path parsing; it lets paths longer than MAX_PATH be used with FindFirstFile. However, each component in the path cannot be more than MAX_PATH characters long. This also works with Universal Naming Convention (UNC) names. The "\\?\" is ignored as part of the path. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private" and "\\?\UNC\bill_g_1\hotstuff\coolapps" is seen as "\\bill_g_1\hotstuff\coolapps."

  • lpFindFileData
    [out] Long pointer to the WIN32_FIND_DATA structure that receives information about the found file or subdirectory.

Return Values

A search handle, used in a subsequent call to CeFindNextFile or CeFindClose, indicates success. INVALID_HANDLE_VALUE indicates failure. To determine if a function failed because of RAPI errors, call CeRapiGetError. To determine if a function failed because of non-RAPI errors, call CeGetLastError.

Remarks

When writing applications for Windows CE versions 1.0 and 1.01, use the PegFindFirstFile function.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 2.0 and later Rapi.h    

See Also

CeGetLastError, FindFirstFile, CeRapiGetError, CE_FIND_DATA, WIN32_FIND_DATA

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.