Skip to content

Commit

Permalink
Modify WinUserNativeMethods, as the interface within changed for supp…
Browse files Browse the repository at this point in the history
…orting multiple user on same machine do enc/dec
  • Loading branch information
sonic6x committed Jun 1, 2016
1 parent 02d5950 commit fc869cc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions HpToolsLauncher/WinUserNativeMethods.cs
Expand Up @@ -8,19 +8,19 @@ public static class WinUserNativeMethods
private static class EncodeUtilsWrap
{
[DllImport("EncodeUtilsWrap", CallingConvention = CallingConvention.Cdecl)]
public static extern void UnprotectBSTRFromBase64([MarshalAs(UnmanagedType.BStr)] string input, [MarshalAs(UnmanagedType.BStr)] out string result);
public static extern void UnprotectBSTRFromBase64([MarshalAs(UnmanagedType.BStr)] string input, [MarshalAs(UnmanagedType.BStr)] out string result, [MarshalAs(UnmanagedType.Bool)] bool bCrypt);

[DllImport("EncodeUtilsWrap", CallingConvention = CallingConvention.Cdecl)]
public static extern void ProtectBSTRToBase64([MarshalAs(UnmanagedType.BStr)] string input, [MarshalAs(UnmanagedType.BStr)] out string result);
public static extern void ProtectBSTRToBase64([MarshalAs(UnmanagedType.BStr)] string input, [MarshalAs(UnmanagedType.BStr)] out string result, [MarshalAs(UnmanagedType.Bool)] bool bCrypt);
}

private static class EncodeUtilsWrapD
{
[DllImport("EncodeUtilsWrapD", CallingConvention = CallingConvention.Cdecl)]
public static extern void UnprotectBSTRFromBase64([MarshalAs(UnmanagedType.BStr)] string input, [MarshalAs(UnmanagedType.BStr)] out string result);
public static extern void UnprotectBSTRFromBase64([MarshalAs(UnmanagedType.BStr)] string input, [MarshalAs(UnmanagedType.BStr)] out string result, [MarshalAs(UnmanagedType.Bool)] bool bCrypt);

[DllImport("EncodeUtilsWrapD", CallingConvention = CallingConvention.Cdecl)]
public static extern void ProtectBSTRToBase64([MarshalAs(UnmanagedType.BStr)] string input, [MarshalAs(UnmanagedType.BStr)] out string result);
public static extern void ProtectBSTRToBase64([MarshalAs(UnmanagedType.BStr)] string input, [MarshalAs(UnmanagedType.BStr)] out string result, [MarshalAs(UnmanagedType.Bool)] bool bCrypt);
}

public static string ProtectBSTRToBase64(string clearData)
Expand All @@ -29,13 +29,13 @@ public static string ProtectBSTRToBase64(string clearData)

try
{
EncodeUtilsWrap.ProtectBSTRToBase64(clearData, out result);
EncodeUtilsWrap.ProtectBSTRToBase64(clearData, out result, true);
}
catch (DllNotFoundException)
{
try
{
EncodeUtilsWrapD.ProtectBSTRToBase64(clearData, out result);
EncodeUtilsWrapD.ProtectBSTRToBase64(clearData, out result, true);
}
catch (DllNotFoundException)
{
Expand All @@ -55,11 +55,11 @@ public static string UnprotectBSTRFromBase64(string protectedData)

try
{
EncodeUtilsWrap.UnprotectBSTRFromBase64(protectedData, out result);
EncodeUtilsWrap.UnprotectBSTRFromBase64(protectedData, out result, true);
}
catch (DllNotFoundException)
{
EncodeUtilsWrapD.UnprotectBSTRFromBase64(protectedData, out result);
EncodeUtilsWrapD.UnprotectBSTRFromBase64(protectedData, out result,true);
}

return result;
Expand Down
Binary file modified src/main/resources/HpToolsAborter.exe
Binary file not shown.
Binary file modified src/main/resources/HpToolsLauncher.exe
Binary file not shown.
Binary file modified src/main/resources/LRAnalysisLauncher.exe
Binary file not shown.

0 comments on commit fc869cc

Please sign in to comment.