C# rapi dll 引用方式,pda数据传输用

[DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeCloseHandle(IntPtr hObject);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeCopyFile(string lpExistingFileName, string lpNewFileName, int bFailIfExists);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeCreateDirectory(string lpPathName, uint lpSecurityAttributes);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern IntPtr CeCreateFile(string lpFileName, uint dwDesiredAccess, int dwShareMode, int lpSecurityAttributes, int dwCreationDisposition, int dwFlagsAndAttributes, int hTemplateFile);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeCreateProcess(string pszImageName, IntPtr pszCmdLine, IntPtr psaProcess, IntPtr psaThread, int fInheritHandles, int fdwCreate, IntPtr pvEnvironment, IntPtr pszCurDir, IntPtr psiStartInfo, out PROCESS_INFORMATION pi);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeCreateProcess(string pszImageName, string pszCmdLine, IntPtr psaProcess, IntPtr psaThread, int fInheritHandles, int fdwCreate, IntPtr pvEnvironment, IntPtr pszCurDir, IntPtr psiStartInfo, out PROCESS_INFORMATION pi);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeDeleteFile(string lpFileName);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeFindClose(IntPtr hFindFile);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern IntPtr CeFindFirstFile(string lpFileName, byte[] lpFindFileData);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeFindNextFile(IntPtr hFindFile, byte[] lpFindFileData);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeGetDesktopDeviceCaps(int nIndex);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern uint CeGetFileAttributes(string lpFileName);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern uint CeGetFileSize(IntPtr hFile, ref uint lpFileSizeHigh);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeGetFileTime(IntPtr hFile, ref long lpCreationTime, ref long lpLastAccessTime, ref long lpLastWriteTime);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeGetLastError();
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeGetSpecialFolderPath(int nFolder, uint nBufferLength, StringBuilder lpBuffer);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeGetStoreInformation(out STORE_INFORMATION lpsi);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeGetSystemInfo(out SYSTEM_INFO pSI);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern bool CeGetSystemPowerStatusEx(out SYSTEM_POWER_STATUS_EX pStatus, bool fUpdate);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern bool CeGetVersionEx(out OSVERSIONINFO lpVersionInformation);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern void CeGlobalMemoryStatus(out MEMORYSTATUS msce);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeMoveFile(string lpExistingFileName, string lpNewFileName);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeRapiGetError();
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeRapiInit();
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeRapiInitEx([MarshalAs(UnmanagedType.Struct)] ref RAPIINIT pRapiInit);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeRapiInvoke(string pDllPath, string pFunctionName, uint cbInput, IntPtr pInput, out uint pcbOutput, out IntPtr ppOutput, IntPtr ppIRAPIStream, uint dwReserved);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeRapiUninit();
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeReadFile(IntPtr hFile, byte[] lpBuffer, int nNumberOfbytesToRead, ref int lpNumberOfbytesRead, int lpOverlapped);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeRemoveDirectory(string lpPathName);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeSetEndOfFile(int hFile);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeSetFileAttributes(string lpFileName, uint dwFileAttributes);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeSetFileTime(IntPtr hFile, ref long lpCreationTime, ref long lpLastAccessTime, ref long lpLastWriteTime);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeSHCreateShortcut(string pShortcutName, string pTarget);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]
        internal static extern int CeSHGetShortcutTarget(string lpszShortcut, string lpszTarget, int cbMax);
        [DllImport("rapi.dll", CharSet=CharSet.Unicode)]
        internal static extern int CeWriteFile(IntPtr hFile, byte[] lpBuffer, int nNumberOfbytesToWrite, ref int lpNumberOfbytesWritten, int lpOverlapped);

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值