Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. void ListExtensions(out int pCount, System.IntPtr pExtensions)
  2.  
  3. public struct ExtensionId
  4. {
  5. public ExtensionGuid data;
  6. }
  7.  
  8. public struct ExtensionGuid
  9. {
  10. public int Data1;
  11. public short Data2;
  12. public short Data3;
  13. public byte[] Data4;
  14. }
  15.  
  16. ExtensionId *ids = new ExtensionId[10];
  17.  
  18. ExtensionId[] ids = new ExtensionId[10];
  19. GCHandle handle = GCHandle.Alloc(ids);
  20. IntPtr ptr = (IntPtr)handle;
  21. int pCount;
  22. ListExtensions(out pCount, ptr);
  23. ExtensionId[] result = (ExtensionId[])handle.Target;
  24.  
  25. The runtime has encountered a fatal error. The address of the error was at 0x73d87e37, on thread 0x5f8. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement