public void Start() { if (DeviceState != State.BeforeOperation) { throw new Exception("Device state invalid for this operation"); } Callback = new GhostIncidentCallback(IncidentCreator); DeviceID = GhostMountDeviceWithID(GhostDeviceID, Callback, IntPtr.Zero, ImageFileName); if (DeviceID == -1) { int Error = GhostGetLastError(); throw new Exception(GhostGetErrorDescription(Error)); } DeviceState = State.Mounted; Mount = DateTime.Now; OnUpdate(); }
private static extern int GhostMountDeviceWithID(int DeviceID, GhostIncidentCallback Callback, IntPtr Context, String ImageName);