/////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Microsoft Corporation. All rights reserved. // using System; using Microsoft.SingSharp; using Microsoft.Singularity.Channels; using Microsoft.Singularity.Directory; namespace Microsoft.Singularity.Directory { contract DirectoryServiceContract : ServiceContract { // Flag values (used in AckAttributes) public enum FileFlags { Normal = 128, Directory = 16, Hidden = 2, ReadOnly = 1, } out message Success(); in message Bind(char[]! in ExHeap path, ServiceContract.Exp:Start! exp); out message AckBind(); out message NakBind(ServiceContract.Exp:Start exp); // return unconnected endpoint in message CreateDirectory(char []! in ExHeap dirName); out message AckCreateDirectory(); out message NakCreateDirectory(); in message DeleteDirectory(char []! in ExHeap dirName); out message AckDeleteDirectory(); out message NakDeleteDirectory(); in message CreateFile(char []! in ExHeap fileName); out message AckCreateFile(); out message NakCreateFile(); in message DeleteFile(char []! in ExHeap fileName); out message AckDeleteFile(); out message NakDeleteFile(); in message Attributes(char []! in ExHeap fileName); out message AckAttributes(long size, uint flags, long linkFlags); out message NakAttributes(); in message QueryACL(char []! in ExHeap fileName, byte[]! in ExHeap permission); out message AckQueryACL(byte[]! in ExHeap acl); out message NakQueryACL(); in message StoreACL(char []! in ExHeap fileName, byte[]! in ExHeap permission, byte[]! in ExHeap acl); out message AckStoreACL(); out message NakStoreACL(); in message CreateLink(char []! in ExHeap linkPath, char []! in ExHeap linkValue ); out message AckCreateLink(); out message NakCreateLink(); in message DeleteLink(char []! in ExHeap linkPath); out message AckDeleteLink(); out message NakDeleteLink(); in message Close(); out message AckClose(); override state Start: one { Success! -> Ready; } state Ready: one { Bind? -> ( AckBind! or NakBind!) -> Ready; CreateDirectory? -> ( AckCreateDirectory! or NakCreateDirectory! ) -> Ready; DeleteDirectory? -> ( AckDeleteDirectory! or NakDeleteDirectory! ) -> Ready; CreateFile? -> (AckCreateFile! or NakCreateFile!) -> Ready; DeleteFile? -> ( AckDeleteFile! or NakDeleteFile!) -> Ready; Attributes? -> (AckAttributes! or NakAttributes!) -> Ready; QueryACL? -> (AckQueryACL! or NakQueryACL!) -> Ready; StoreACL? -> (AckStoreACL! or NakStoreACL!) -> Ready; CreateLink? -> ( AckCreateLink! or NakCreateLink! ) -> Ready; DeleteLink? -> ( AckDeleteLink! or NakDeleteLink! ) -> Ready; Close? -> AckClose! -> Ready; } } }