Home |
Media Transfer Protocol Class Driver Function USBMTPFindFirstFile Function USBMTPGetFileProperty Function USBMTPSetFileProperty |
Function USBMTPFindFirstFileUSBMTPFindFirstFile searches a directory of a storage device on a USB MTP device: typedef DWORD USBMTPHandle; int USBMTPFindFirstFile(int Dev, int Store, USBMTPHandle DirHandle, USBMTPFindData * FindData, USBMTPHandle * Handle); ParametersDevIndex of the MTP device. This value should be in range 0 .. RTUSBMTPConfig.MaxDevices - 1. StoreZero-based index of the storage device. Function USBMTPGetDevInfo can determine how many storage devices are available. DirHandleHandle of the directory to search. For the root directory, use value USBMTP_ROOTDIR. To find all files in all directories, use USBMTP_ALLDIRS. This parameter also accepts the handle of any subdirectory. FindDataPointer to a variable of type USBMTPFindData. HandlePointer to the handle to be returned. return valueIf successful, a value >= RTU_SUCCESS is returned, otherwise, a negative error code. If at least one file is found, the returned handle can be used with function USBMTPGetFileInfo to get further data about the file. To continue the search, use function USBMTPFindNextFile. When the search is finished, function USBMTPFindCloseFile must be called to free all resources associated with the search. Functions Tree, Dir, and FindFile of demo program MTPDemo show how this function is used.
|