private static void CreateVtable() { comVtable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IStreamVtbl))); Marshal.StructureToPtr(managedVtable, comVtable, false); }