📄 dmapidefinitions.cs
字号:
public System.Runtime.InteropServices.ComTypes.FILETIME tFolderTime;
[MarshalAs(UnmanagedType.LPWStr)]
// Drive lable name
public string pstrLabel;
[MarshalAs(UnmanagedType.LPWStr)]
// Folder or Drive memory type
public string pstrMemoryType;
}
// File info structure
public struct CONAPI_FILE_INFO
{
[MarshalAs(UnmanagedType.LPWStr)]
// File name
public string pstrName;
// File permission
public int iAttributes;
// File modified time
public System.Runtime.InteropServices.ComTypes.FILETIME tFileTime;
// File size
public int iFileSize;
[MarshalAs(UnmanagedType.LPWStr)]
// File MIME type
public string pstrMIMEType;
}
// Folder info structure
public struct CONAPI_FOLDER_INFO2
{
// Size of struct
public int iSize;
[MarshalAs(UnmanagedType.LPWStr)]
// Folder or Drive name
public string pstrName;
[MarshalAs(UnmanagedType.LPWStr)]
// Absolute location path to folder or drive
public string pstrLocation;
// Folder or Drive type and permission
public int iAttributes;
// Folder time
public System.Runtime.InteropServices.ComTypes.FILETIME tFolderTime;
[MarshalAs(UnmanagedType.LPWStr)]
// Drive lable name
public string pstrLabel;
[MarshalAs(UnmanagedType.LPWStr)]
// Folder or Drive memory type
public string pstrMemoryType;
[MarshalAs(UnmanagedType.LPWStr)]
// Identification ID
public string pstrID;
// Free memory in drive
public long dlFreeMemory;
// Total memory in drive
public long dlTotalMemory;
// Used memory in drive
public long dlUsedMemory;
// Number of files in target folder or drive
public int iContainFiles;
// Number of folders in target folder or drive
public int iContainFolders;
// Size of folder content (including content of subfolders)
public long dlTotalSize;
[MarshalAs(UnmanagedType.LPWStr)]
// Reserved for future
public string pstrValue;
}
// Folder content structure
public struct CONAPI_FOLDER_CONTENT
{
// Size of struct
public int iSize;
// CONAPI_FOLDER_INFO2* pFolderInfo; Folder info struct
public System.IntPtr pFolderInfo;
[MarshalAs(UnmanagedType.LPWStr)]
// Absolute path of sub files and sub folders
public string pstrPath;
// Number of file structs
public int iNumberOfFileInfo;
// CONAPI_FILE_INFO* pFileInfo; File structs
public System.IntPtr pFileInfo;
// Number of file structs
public int iNumberOfSubFolderContent;
// CONAPI_FOLDER_CONTENT* pSubFolderContent; File structs
public System.IntPtr pSubFolderContent;
// CONAPI_FOLDER_CONTENT* pParentFolder; Pointer to the parent folder content struct
public System.IntPtr pParentFolder;
[MarshalAs(UnmanagedType.LPWStr)]
// Reserved for future
public string pstrValue;
}
// ----------------------------------------------------
// FSNotifyCallbackDelegate function:
//
// ----------------------------------------------------
// This is the function prototype of the callback method
//
public delegate int FSNotifyCallbackDelegate(
int iOperation,
int iStatus,
int iTransferredBytes,
int iAllBytes
);
// ----------------------------------------------------
// FSFolderInfoCallbackDelegate function:
//
// ----------------------------------------------------
// This is the function prototype of the callback method
//
// typedef DWORD (CALLBACK *PFN_CONA_FS_FOLDERINFO_CALLBACK)(LPCONAPI_FOLDER_INFO2 pFolderInfo);
public delegate int FSFolderInfoCallbackDelegate(System.IntPtr pFolderInfo);
// ----------------------------------------------------
// CONABlockDataCallbackFunction function:
//
// Callback function prototype:
// typedef DWORD (CALLBACK *PFN_CONA_FS_BLOCKDATA_CALLBACK)(
// DWORD dwFSFunction,
// DWORD *pdwState,
// const DWORD dwSizeOfFileDataBlockBuffer,
// DWORD *pdwFileDataBlockLenght,
// unsigned char* pFileDataBlock);
public delegate int FSBlockDataCallbackDelegate(
int iFSFunction,
ref int iState,
int iSizeOfFileDataBlockBuffer,
ref int iFileDataBlockLenght,
System.IntPtr pFileDataBlock);
// ----------------------------------------------------
// FSFunction values:
public const int CONARefreshDeviceMemoryValuesNtf = 1;
public const int CONASetCurrentFolderNtf = 2;
public const int CONAFindBeginNtf = 4;
public const int CONACreateFolderNtf = 8;
public const int CONADeleteFolderNtf = 16;
public const int CONARenameFolderNtf = 32;
public const int CONAGetFileInfoNtf = 64;
public const int CONADeleteFileNtf = 128;
public const int CONAMoveFileNtf = 256;
public const int CONACopyFileNtf = 512;
public const int CONARenameFileNtf = 1024;
public const int CONAReadFileNtf = 2048;
public const int CONAWriteFileNtf = 4096;
public const int CONAConnectionLostNtf = 8192;
public const int CONAInstallApplicationNtf = 16384;
public const int CONAConvertFileNtf = 32768;
public const int CONAGetFolderInfoNtf = 65536;
public const int CONAListApplicationNtf = 131072;
public const int CONAUninstallApplicationNtf = 262144;
public const int CONAReadFileInBlocksNtf = 524288;
public const int CONAWriteFileInBlocksNtf = 1048576;
public const int CONAMoveFolderNtf = 2097152;
public const int CONACopyFolderNtf = 4194304;
public const int CONAGetFileMetadataNtf = 8388608;
// The next function do not send notifications:
// CONAOpenFS
// CONACloseFS
// CONARegisterFSNotifyCallback
// CONAGetMemoryTypes
// CONAGetMemoryValues
// CONAGetCurrentFolder
// CONAFindNextFolder
// CONAFindNextFile
// CONAFindEnd
// CONACancel
// Possible error codes value in dwStatus parameter when
// FSFunction value is CONAConnectionLost:
// ECONA_CONNECTION_LOST
// ECONA_CONNECTION_REMOVED
// ECONA_CONNECTION_FAILED
// ECONA_SUSPEND
// ----------------------------------------------------
// CONAMediaCallback
//
// This is the function prototype of the callback method
//
// DWORD CALLBACK CONAMediaCallback(DWORD dwStatus, API_MEDIA* pMedia);
public delegate int MediaCallbackDelegate(
int iStatus,
System.IntPtr pMedia
);
// ----------------------------------------------------
// Media info structure
public struct API_MEDIA
{
public int iSize;
public int iMedia;
[MarshalAs(UnmanagedType.LPWStr)]
public string pstrDescription;
public int iState;
public int iOptions;
public int iMediaData;
[MarshalAs(UnmanagedType.LPWStr)]
public string pstrID;
}
//Synchronication support:
// Media is active.
public const int API_MEDIA_ACTIVE = 1;
// Media is not active.
public const int API_MEDIA_NOT_ACTIVE = 2;
// Media is supporting incoming connections.
public const int API_MEDIA_IC_SUPPORTED = 16;
// Media is not supporting incoming connections.
public const int API_MEDIA_IC_NOT_SUPPORTED = 32;
public static int CONAPI_GET_MEDIA_TYPE(int iMedia)
{
return 255 & iMedia;
}
public static int CONAPI_IS_MEDIA_ACTIVE(int iState)
{
return 1 & iState;
}
public static int CONAPI_IS_MEDIA_UNACTIVE(int iState)
{
return (2 & iState) >> 1;
}
public static int CONAPI_IS_IC_SUPPORTED(int iOptions)
{
return (16 & iOptions) >> 4;
}
public static int CONAPI_IS_IC_UNSUPPORTED(int iOptions)
{
return (32 & iOptions) >> 5;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -