static void Main(string[] args) { Process proc = new Process(); BasicObjectDef definition = new BasicObjectDef(); FieldDefinition[] fields = new FieldDefinition[1]; try { proc.Init("10701", false); } catch(PhotonException e) { Console.WriteLine(e.ToString()); Console.WriteLine("Init"); Environment.Exit(e.ErrorCode()); } int rc = 0; Console.WriteLine("Init" + rc); Session sess = new Session(); definition.type = ObjectType.FOLDER; sess.CreateObject("/Test", ref definition, fields); sess.Commit(); ObjStatus status = new ObjStatus(); sess.GetStatus("/Test", ref status); }
// --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- public void Status(ref ObjStatus status) { int rc; if (sessionHandle == (IntPtr)0 || handle == (IntPtr)0) { rc = (int)PhotonErrors.NULL_HANDLE; throw new PhotonException(PhotonException.PrepareException("FastMapEditor.Status", rc), rc); } rc = psoFastMapStatus(handle, ref status); if (rc != 0) { throw new PhotonException(PhotonException.PrepareException(sessionHandle, "FastMapEditor.Status"), rc); } }
private static extern int psoFolderStatus( IntPtr objectHandle, ref ObjStatus pStatus);
private static extern int psoQueueStatus( IntPtr objectHandle, ref ObjStatus pStatus);
internal static extern int psoFastMapStatus( IntPtr objectHandle, ref ObjStatus pStatus);
private static extern int psoHashMapStatus( IntPtr objectHandle, ref ObjStatus pStatus);
// --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- public void GetStatus( String objectName, ref ObjStatus status) { int rc; if (handle == (IntPtr)0) { rc = (int)PhotonErrors.NULL_HANDLE; throw new PhotonException(PhotonException.PrepareException("Session.GetStatus", rc), rc); } rc = psoGetStatus(handle, objectName, (UInt32)objectName.Length, ref status); if (rc != 0) { throw new PhotonException(PhotonException.PrepareException(handle, "Session.GetStatus"), rc); } }
private static extern int psoGetStatus( IntPtr sessionHandle, [MarshalAs(UnmanagedType.LPStr)] string objectName, UInt32 nameLengthInBytes, ref ObjStatus pStatus);