Merge pull request #1597 from PowerShell/mirichmo/fixing-reverse-pinvoke

Fixing reverse PInvoke worker callback pointer structure layout to sy…
This commit is contained in:
Mike Richmond 2016-08-01 15:33:10 -07:00 committed by GitHub
commit 38143711f9
2 changed files with 5 additions and 1 deletions

View file

@ -360,7 +360,7 @@ namespace System.Management.Automation.Remoting
/// <summary>
/// Structure definition to match the native one.
/// NOTE: The layout of this structure must be IDENTICAL between here and WSManPluginEntryDelegates in pwrshplugin.h!
/// NOTE: The layout of this structure must be IDENTICAL between here and PwrshPluginWkr_Ptrs in pwrshplugindefs.h!
/// </summary>
[StructLayout(LayoutKind.Sequential)]
internal class WSManPluginEntryDelegatesInternal

View file

@ -115,6 +115,9 @@ typedef void (WINAPI *WSManPluginSignalFuncPtr)(
__in_opt PVOID commandContext,
__in PCWSTR code);
typedef void (WINAPI *WSManPluginOperationShutdownFuncPtr)(
__in PVOID pluginContext);
typedef struct _PwrshPluginWkr_Ptrs
{
ShutdownPluginFuncPtr shutdownPluginFuncPtr;
@ -126,6 +129,7 @@ typedef struct _PwrshPluginWkr_Ptrs
WSManPluginReceiveFuncPtr wsManPluginReceiveFuncPtr;
WSManPluginSignalFuncPtr wsManPluginSignalFuncPtr;
WSManPluginConnectFuncPtr wsManPluginConnectFuncPtr;
WSManPluginOperationShutdownFuncPtr wsmanPluingOperationShutdownFuncPtr; // This ptr is not used in this environment, but is required to keep the memory layout identical between unmanaged and managed code.
} PwrshPluginWkr_Ptrs;
class PlugInException