home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / trkcom.idl < prev    next >
Text File  |  1998-04-25  |  5KB  |  155 lines

  1.  
  2. //-------------------------------------------------------
  3. //
  4. //  ITrackFile
  5. //
  6. //  This interface can be used to create a reliable link
  7. //  to a file.  This interface is not remotable.
  8. //
  9. //-------------------------------------------------------
  10.  
  11. cpp_quote( "EXTERN_C const CLSID CLSID_TrackFile; // {8790c947-a30b-11d0-8cab-00c04fd90f85}" )
  12.  
  13. [
  14.     local,
  15.     uuid(8790c948-a30b-11d0-8cab-00c04fd90f85),
  16.     object,
  17.     pointer_default(unique),
  18.     version(1.0)
  19. ]
  20. interface ITrackFile : IUnknown
  21. {
  22.     import "unknwn.idl";
  23.  
  24.     // Get necessary link state from a path
  25.  
  26.     HRESULT CreateFromPath( [in, string] const OLECHAR * poszPath );
  27.  
  28.     // Use state from CreateFromPath to determine
  29.     // the current path
  30.  
  31.     HRESULT Resolve( [in, out] DWORD * pcbPath,
  32.                      [out, size_is(*pcbPath), string] OLECHAR * poszPath,
  33.                      [in] DWORD dwMillisecondTimeout );
  34.  
  35.     // Open the file.  Use the path as a hint, but ensure that the
  36.     // correct object ID is opened.  This method will Resolve if
  37.     // necessary.
  38.  
  39.     HRESULT Open( [in, out] DWORD * pcbPathHint,
  40.            [in, out, size_is(*pcbPathHint), string] OLECHAR * poszPathHint,
  41.            [in] DWORD dwMillisecondTimeout,
  42.           [in] DWORD dwDesiredAccess,    // access (read-write) mode 
  43.               [in] DWORD dwShareMode,    // share mode 
  44.           [in] DWORD dwFlags,
  45.                   [out] HANDLE * phFile );
  46. }
  47.  
  48.  
  49. //-------------------------------------------------------
  50. //
  51. //  ITrackStorage
  52. //
  53. //  This interface can be used to create a reliable link
  54. //  to a structured storage.  This interface is remotable.
  55. //
  56. //-------------------------------------------------------
  57.  
  58. [
  59.     uuid(8790c94a-a30b-11d0-8cab-00c04fd90f85),
  60.     object,
  61.     pointer_default(unique),
  62.     version(1.0)
  63. ]
  64. interface ITrackStorage : IUnknown
  65. {
  66.     import "unknwn.idl";
  67.  
  68.     // Get necessary link state from a path
  69.  
  70.     HRESULT CreateFromPath( [in, string] const OLECHAR * poszPath );
  71.  
  72.     // Use state from CreateFromPath to determine
  73.     // the current path
  74.  
  75.     HRESULT Resolve( [in, out] DWORD * pcbPath,
  76.                      [out, size_is(*pcbPath), string] OLECHAR * poszPath,
  77.                      [in] DWORD dwMillisecondTimeout );
  78.  
  79.     // Open the storage.  Use the path as a hint, but ensure that the
  80.     // correct object ID is opened.  This method will Resolve if
  81.     // necessary.  The parameters are the same as in StgOpenStorageEx.
  82.  
  83.     HRESULT OpenStorageEx( [in, out] DWORD * pcbPathHint,
  84.                     [in, out, size_is(*pcbPathHint), string] OLECHAR * poszPathHint,
  85.                            [in] DWORD dwMillisecondTimeout,
  86.                     [in] DWORD grfMode,
  87.                            [in] DWORD stgfmt,              // enum
  88.                            [in] DWORD grfAttrs,            // reserved
  89.                            [in] REFIID riid,
  90.                            [out, iid_is(riid)] void ** ppObjectOpen );
  91.  
  92. }
  93.  
  94.  
  95. //-------------------------------------------------------
  96. //
  97. //  ITrackFileRestricted
  98. //
  99. //  This interface is used for testing purposed only.
  100. //  It is equivalent to ITrackFile, except the Resolve
  101. //  method allows for special restrictions.
  102. //
  103. //-------------------------------------------------------
  104.  
  105. [
  106.     local,
  107.     uuid(8790c949-a30b-11d0-8cab-00c04fd90f85),
  108.     object,
  109.     pointer_default(unique),
  110.     version(1.0)
  111. ]
  112. interface ITrackFileRestricted : IUnknown
  113. {
  114.     import "unknwn.idl";
  115.  
  116.     cpp_quote("")
  117.     cpp_quote("// 'Restrictions' flags")
  118.     typedef enum _TrkMendRestrictions
  119.     {
  120.         TRK_MEND_DEFAULT                    = 0,
  121.         TRK_MEND_LAST_ONLY                  = 1,
  122.         TRK_MEND_DONT_USE_LOG               = 2,
  123.         TRK_MEND_DONT_USE_DC                = 4,
  124.         TRK_MEND_SLEEP_DURING_SEARCH        = 8,
  125.         TRK_MEND_DONT_SEARCH_ALL_VOLUMES    = 16,
  126.         TRK_MEND_DONT_USE_VOLIDS            = 32
  127.     } TrkMendRestrictions;
  128.     
  129.  
  130.     // Get necessary link state from a path
  131.  
  132.     HRESULT CreateFromPath( [in, string] const OLECHAR * poszPath );
  133.  
  134.     // Use state from CreateFromPath to determine
  135.     // the current path
  136.  
  137.     HRESULT Resolve( [in, out] DWORD * pcbPath,
  138.                      [out, size_is(*pcbPath), string] OLECHAR * poszPath,
  139.                      [in] DWORD dwMillisecondTimeout,
  140.                      [in] DWORD Restrictions );
  141.  
  142.     // Open the file.  Use the path as a hint, but ensure that the
  143.     // correct object ID is opened.  This method will Resolve if
  144.     // necessary.
  145.  
  146.     HRESULT Open ([in, out] DWORD * pcbPathHint,
  147.            [in, out, size_is(*pcbPathHint), string] OLECHAR * poszPathHint,
  148.            [in] DWORD dwMillisecondTimeout,
  149.           [in] DWORD dwDesiredAccess,    // access (read-write) mode 
  150.               [in] DWORD dwShareMode,    // share mode 
  151.           [in] DWORD dwFlags,
  152.                   [out] HANDLE * phFile );
  153. }
  154.  
  155.