diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/SDK/Finance/InteropServices/FinanceDllLinuxPInvoker.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/SDK/Finance/InteropServices/FinanceDllLinuxPInvoker.cs index 065bd79e..2ff5d229 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Work/SDK/Finance/InteropServices/FinanceDllLinuxPInvoker.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/SDK/Finance/InteropServices/FinanceDllLinuxPInvoker.cs @@ -11,51 +11,52 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.SDK.Finance.InteropServices public static extern IntPtr NewSdk(); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int Init(IntPtr sdk, string corpId, string secret); + public static extern int Init([In] IntPtr sdk, [In] string corpId, [In] string secret); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int GetChatData(IntPtr sdk, long seq, long limit, string proxy, string passwd, long timeout, IntPtr chatData); + public static extern int GetChatData([In] IntPtr sdk, [In] long seq, [In] long limit, [In] string proxy, [In] string passwd, [In] long timeout, [Out] IntPtr chatData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int GetMediaData(IntPtr sdk, string indexBuf, string fileId, string proxy, string passwd, long timeout, IntPtr mediaData); + public static extern int GetMediaData([In] IntPtr sdk, [In] string indexBuf, [In] string fileId, [In] string proxy, [In] string passwd, [In] long timeout, [Out] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int DecryptData(string encryptKey, string encryptMsg, IntPtr msgData); + public static extern int DecryptData([In] string encryptKey, [In] string encryptMsg, [Out] IntPtr msgData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern void DestroySdk(IntPtr sdk); + public static extern void DestroySdk([In] IntPtr sdk); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr NewSlice(); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern void FreeSlice(IntPtr slice); + public static extern void FreeSlice([In] IntPtr slice); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern string GetContentFromSlice(IntPtr slice); + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + public static extern string GetContentFromSlice([In] IntPtr slice); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int GetSliceLen(IntPtr slice); + public static extern int GetSliceLen([In] IntPtr slice); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr NewMediaData(); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern void FreeMediaData(IntPtr mediaData); + public static extern void FreeMediaData([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern string GetOutIndexBuf(IntPtr mediaData); + public static extern string GetOutIndexBuf([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr GetData(IntPtr mediaData); + public static extern IntPtr GetData([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int GetIndexLen(IntPtr mediaData); + public static extern int GetIndexLen([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int GetDataLen(IntPtr mediaData); + public static extern int GetDataLen([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] - public static extern int IsMediaDataFinish(IntPtr mediaData); + public static extern int IsMediaDataFinish([In] IntPtr mediaData); } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/SDK/Finance/InteropServices/FinanceDllWindowsPInvoker.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/SDK/Finance/InteropServices/FinanceDllWindowsPInvoker.cs index bc5c9e3d..1a4abf1d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Work/SDK/Finance/InteropServices/FinanceDllWindowsPInvoker.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/SDK/Finance/InteropServices/FinanceDllWindowsPInvoker.cs @@ -14,23 +14,23 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.SDK.Finance.InteropServices [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern int Init(IntPtr sdk, string corpId, string secret); + public static extern int Init([In] IntPtr sdk, [In] string corpId, [In] string secret); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern int GetChatData(IntPtr sdk, long seq, long limit, string proxy, string passwd, long timeout, IntPtr chatData); + public static extern int GetChatData([In] IntPtr sdk, [In] long seq, [In] long limit, [In] string proxy, [In] string passwd, [In] long timeout, [Out] IntPtr chatData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern int GetMediaData(IntPtr sdk, string indexBuf, string fileId, string proxy, string passwd, long timeout, IntPtr mediaData); + public static extern int GetMediaData([In] IntPtr sdk, [In] string indexBuf, [In] string fileId, [In] string proxy, [In] string passwd, [In] long timeout, [Out] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern int DecryptData(string encryptKey, string encryptMsg, IntPtr msgData); + public static extern int DecryptData([In] string encryptKey, [In] string encryptMsg, [Out] IntPtr msgData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern void DestroySdk(IntPtr sdk); + public static extern void DestroySdk([In] IntPtr sdk); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] @@ -38,16 +38,16 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.SDK.Finance.InteropServices [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern void FreeSlice(IntPtr slice); + public static extern void FreeSlice([In] IntPtr slice); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] - public static extern string GetContentFromSlice(IntPtr slice); + public static extern string GetContentFromSlice([In] IntPtr slice); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern int GetSliceLen(IntPtr slice); + public static extern int GetSliceLen([In] IntPtr slice); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] @@ -55,26 +55,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.SDK.Finance.InteropServices [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern void FreeMediaData(IntPtr mediaData); + public static extern void FreeMediaData([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern string GetOutIndexBuf(IntPtr mediaData); + public static extern string GetOutIndexBuf([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern IntPtr GetData(IntPtr mediaData); + public static extern IntPtr GetData([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern int GetIndexLen(IntPtr mediaData); + public static extern int GetIndexLen([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern int GetDataLen(IntPtr mediaData); + public static extern int GetDataLen([In] IntPtr mediaData); [DllImport(DLL_NAME, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] [SuppressUnmanagedCodeSecurity] - public static extern int IsMediaDataFinish(IntPtr mediaData); + public static extern int IsMediaDataFinish([In] IntPtr mediaData); } }