Home |
Media Transfer Protocol Class Driver Function USBMTPGetFileInfo Function USBMTPGetFileProperty Function USBMTPSetFileProperty |
Function USBMTPGetFileInfoUSBMTPGetFileInfo retrieves information about a particular file or directory on a USB MTP device: typedef struct { DWORD StorageID; WORD ObjectFormat; WORD ProtectionStatus; DWORD ObjectCompressedSize; WORD ThumbFormat; WORD Alignment1; DWORD ThumbCompressedSize; DWORD ThumbPixWidth; DWORD ThumbPixHeight; DWORD ImagePixWidth; DWORD ImagePixHeight; DWORD ImagePixDepth; USBMTPHandle ParentObject; WORD AssociationType; WORD Alignment2; DWORD AssociationDescription; DWORD SequenceNumber; const wchar_t * Filename; const wchar_t * DateCreated; const wchar_t * DateModified; const wchar_t * Keywords; } USBMTPFileInfo; int USBMTPGetFileInfo(int Dev, USBMTPHandle Handle, USBMTPFileInfo * Info); ParametersDevIndex of the MTP device. This value should be in range 0 .. RTUSBMTPConfig.MaxDevices - 1. HandleHandle of the file or directory for which data is requested. This handle could have been retrieved through functions USBMTPFindFirstFile/USBMTPFindNextFile. InfoPointer to a structure to receive information about the specified file or directory. return valueIf successful, a value >= RTU_SUCCESS is returned, otherwise, a negative error code. *Info is filled with information about the requested file or directory. ObjectFormat is USBMTP_FORMAT_FOLDER for directories. Further format values are listed in include file Include\Rtusb.h (all USBMTP_FORMAT_... constants). ObjectCompressedSize is the file size. ParentObject is the handle of the directory containing the object or 0 if it resides in the root directory. The date/time strings pointed to by DateCreated and DateModified have the ISO 8601 format: "YYYYMMDDThhmmss". All Unicode strings pointed to by members of USBMTPFileInfo reside in the internal data buffer of the MTP driver. They will be overwritten by the next MTP driver API call. If these strings are needed long term, they must be copied to some other location. MTP Unicode strings have at most 255 characters. Functions Tree, Dir, and CD of demo program MTPDemo show how this function is used. For further details about the data returned in structure USBMTPFileInfo, please see section 5.3.1 of the USB Media Transfer Protocol Specification, Revision 1.1.
|