internal static int SystemFunction041 ( [In,Out] byte[] pDataIn, [In] uint cbDataIn, // multiple of RTL_ENCRYPT_MEMORY_SIZE [In] uint dwFlags) { // Semi-trusted callers are not allowed to use DPAPI since it uses the user/machine credentials. DataProtectionPermission dp = new DataProtectionPermission(DataProtectionPermissionFlags.UnprotectMemory); dp.Demand(); return CAPIUnsafe.SystemFunction041(pDataIn, cbDataIn, dwFlags); }
internal static bool CryptUnprotectData ( [In] IntPtr pDataIn, [In] IntPtr ppszDataDescr, [In] IntPtr pOptionalEntropy, [In] IntPtr pvReserved, [In] IntPtr pPromptStruct, [In] uint dwFlags, [In,Out] IntPtr pDataBlob) { // Semi-trusted callers are not allowed to use DPAPI since it uses the user/machine credentials. DataProtectionPermission dp = new DataProtectionPermission(DataProtectionPermissionFlags.UnprotectData); dp.Demand(); return CAPIUnsafe.CryptUnprotectData(pDataIn, ppszDataDescr, pOptionalEntropy, pvReserved, pPromptStruct, dwFlags, pDataBlob); }