home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / lmrepl.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  7KB  |  276 lines

  1. /*++ BUILD Version: 0004    // Increment this if a change has global effects
  2.  
  3. Copyright 1991-1998 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     LmRepl.h
  8.  
  9. Abstract:
  10.  
  11.     This file contains structures, function prototypes, and definitions
  12.     for the replicator APIs.
  13.  
  14. Environment:
  15.  
  16.     User Mode - Win32
  17.     Portable to any flat, 32-bit environment.  (Uses Win32 typedefs.)
  18.     Requires ANSI C extensions: slash-slash comments, long external names.
  19.  
  20. Notes:
  21.  
  22.     You must include LmCons.h before this file.
  23.  
  24.  
  25. --*/
  26.  
  27. #ifndef _LMREPL_
  28. #define _LMREPL_
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. //
  35. // Replicator Configuration APIs
  36. //
  37.  
  38. #define REPL_ROLE_EXPORT        1
  39. #define REPL_ROLE_IMPORT        2
  40. #define REPL_ROLE_BOTH          3
  41.  
  42.  
  43. #define REPL_INTERVAL_INFOLEVEL         (PARMNUM_BASE_INFOLEVEL + 0)
  44. #define REPL_PULSE_INFOLEVEL            (PARMNUM_BASE_INFOLEVEL + 1)
  45. #define REPL_GUARDTIME_INFOLEVEL        (PARMNUM_BASE_INFOLEVEL + 2)
  46. #define REPL_RANDOM_INFOLEVEL           (PARMNUM_BASE_INFOLEVEL + 3)
  47.  
  48.  
  49. typedef struct _REPL_INFO_0 {
  50.     DWORD          rp0_role;
  51.     LPWSTR         rp0_exportpath;
  52.     LPWSTR         rp0_exportlist;
  53.     LPWSTR         rp0_importpath;
  54.     LPWSTR         rp0_importlist;
  55.     LPWSTR         rp0_logonusername;
  56.     DWORD          rp0_interval;
  57.     DWORD          rp0_pulse;
  58.     DWORD          rp0_guardtime;
  59.     DWORD          rp0_random;
  60. } REPL_INFO_0, *PREPL_INFO_0, *LPREPL_INFO_0;
  61.  
  62. typedef struct _REPL_INFO_1000 {
  63.     DWORD          rp1000_interval;
  64. } REPL_INFO_1000, *PREPL_INFO_1000, *LPREPL_INFO_1000;
  65.  
  66. typedef struct _REPL_INFO_1001 {
  67.     DWORD          rp1001_pulse;
  68. } REPL_INFO_1001, *PREPL_INFO_1001, *LPREPL_INFO_1001;
  69.  
  70. typedef struct _REPL_INFO_1002 {
  71.     DWORD          rp1002_guardtime;
  72. } REPL_INFO_1002, *PREPL_INFO_1002, *LPREPL_INFO_1002;
  73.  
  74. typedef struct _REPL_INFO_1003 {
  75.     DWORD          rp1003_random;
  76. } REPL_INFO_1003, *PREPL_INFO_1003, *LPREPL_INFO_1003;
  77.  
  78.  
  79. NET_API_STATUS NET_API_FUNCTION
  80. NetReplGetInfo (
  81.     IN LPCWSTR servername OPTIONAL,
  82.     IN DWORD level,
  83.     OUT LPBYTE * bufptr
  84.     );
  85.  
  86. NET_API_STATUS NET_API_FUNCTION
  87. NetReplSetInfo (
  88.     IN LPCWSTR servername OPTIONAL,
  89.     IN DWORD level,
  90.     IN const LPBYTE buf,
  91.     OUT LPDWORD parm_err OPTIONAL
  92.     );
  93.  
  94.  
  95. //
  96. // Replicator Export Directory APIs
  97. //
  98.  
  99. #define REPL_INTEGRITY_FILE     1
  100. #define REPL_INTEGRITY_TREE     2
  101.  
  102.  
  103. #define REPL_EXTENT_FILE        1
  104. #define REPL_EXTENT_TREE        2
  105.  
  106.  
  107. #define REPL_EXPORT_INTEGRITY_INFOLEVEL (PARMNUM_BASE_INFOLEVEL + 0)
  108. #define REPL_EXPORT_EXTENT_INFOLEVEL    (PARMNUM_BASE_INFOLEVEL + 1)
  109.  
  110.  
  111. typedef struct _REPL_EDIR_INFO_0 {
  112.     LPWSTR         rped0_dirname;
  113. } REPL_EDIR_INFO_0, *PREPL_EDIR_INFO_0, *LPREPL_EDIR_INFO_0;
  114.  
  115. typedef struct _REPL_EDIR_INFO_1 {
  116.     LPWSTR         rped1_dirname;
  117.     DWORD          rped1_integrity;
  118.     DWORD          rped1_extent;
  119. } REPL_EDIR_INFO_1, *PREPL_EDIR_INFO_1, *LPREPL_EDIR_INFO_1;
  120.  
  121. typedef struct _REPL_EDIR_INFO_2 {
  122.     LPWSTR         rped2_dirname;
  123.     DWORD          rped2_integrity;
  124.     DWORD          rped2_extent;
  125.     DWORD          rped2_lockcount;
  126.     DWORD          rped2_locktime;
  127. } REPL_EDIR_INFO_2, *PREPL_EDIR_INFO_2, *LPREPL_EDIR_INFO_2;
  128.  
  129. typedef struct _REPL_EDIR_INFO_1000 {
  130.     DWORD          rped1000_integrity;
  131. } REPL_EDIR_INFO_1000, *PREPL_EDIR_INFO_1000, *LPREPL_EDIR_INFO_1000;
  132.  
  133. typedef struct _REPL_EDIR_INFO_1001 {
  134.     DWORD          rped1001_extent;
  135. } REPL_EDIR_INFO_1001, *PREPL_EDIR_INFO_1001, *LPREPL_EDIR_INFO_1001;
  136.  
  137.  
  138. NET_API_STATUS NET_API_FUNCTION
  139. NetReplExportDirAdd (
  140.     IN LPCWSTR servername OPTIONAL,
  141.     IN DWORD level,
  142.     IN const LPBYTE buf,
  143.     OUT LPDWORD parm_err OPTIONAL
  144.     );
  145.  
  146. NET_API_STATUS NET_API_FUNCTION
  147. NetReplExportDirDel (
  148.     IN LPCWSTR servername OPTIONAL,
  149.     IN LPCWSTR dirname
  150.     );
  151.  
  152. NET_API_STATUS NET_API_FUNCTION
  153. NetReplExportDirEnum (
  154.     IN LPCWSTR servername OPTIONAL,
  155.     IN DWORD level,
  156.     OUT LPBYTE * bufptr,
  157.     IN DWORD prefmaxlen,
  158.     OUT LPDWORD entriesread,
  159.     OUT LPDWORD totalentries,
  160.     IN OUT LPDWORD resumehandle OPTIONAL
  161.     );
  162.  
  163. NET_API_STATUS NET_API_FUNCTION
  164. NetReplExportDirGetInfo (
  165.     IN LPCWSTR servername OPTIONAL,
  166.     IN LPCWSTR dirname,
  167.     IN DWORD level,
  168.     OUT LPBYTE * bufptr
  169.     );
  170.  
  171. NET_API_STATUS NET_API_FUNCTION
  172. NetReplExportDirSetInfo (
  173.     IN LPCWSTR servername OPTIONAL,
  174.     IN LPCWSTR dirname,
  175.     IN DWORD level,
  176.     IN const LPBYTE buf,
  177.     OUT LPDWORD parm_err OPTIONAL
  178.     );
  179.  
  180. NET_API_STATUS NET_API_FUNCTION
  181. NetReplExportDirLock (
  182.     IN LPCWSTR servername OPTIONAL,
  183.     IN LPCWSTR dirname
  184.     );
  185.  
  186. NET_API_STATUS NET_API_FUNCTION
  187. NetReplExportDirUnlock (
  188.     IN LPCWSTR servername OPTIONAL,
  189.     IN LPCWSTR dirname,
  190.     IN DWORD unlockforce
  191.     );
  192.  
  193.  
  194. #define REPL_UNLOCK_NOFORCE     0
  195. #define REPL_UNLOCK_FORCE       1
  196.  
  197.  
  198. //
  199. // Replicator Import Directory APIs
  200. //
  201.  
  202.  
  203. typedef struct _REPL_IDIR_INFO_0 {
  204.     LPWSTR         rpid0_dirname;
  205. } REPL_IDIR_INFO_0, *PREPL_IDIR_INFO_0, *LPREPL_IDIR_INFO_0;
  206.  
  207. typedef struct _REPL_IDIR_INFO_1 {
  208.     LPWSTR         rpid1_dirname;
  209.     DWORD          rpid1_state;
  210.     LPWSTR         rpid1_mastername;
  211.     DWORD          rpid1_last_update_time;
  212.     DWORD          rpid1_lockcount;
  213.     DWORD          rpid1_locktime;
  214. } REPL_IDIR_INFO_1, *PREPL_IDIR_INFO_1, *LPREPL_IDIR_INFO_1;
  215.  
  216.  
  217. NET_API_STATUS NET_API_FUNCTION
  218. NetReplImportDirAdd (
  219.     IN LPCWSTR servername OPTIONAL,
  220.     IN DWORD level,
  221.     IN const LPBYTE buf,
  222.     OUT LPDWORD parm_err OPTIONAL
  223.     );
  224.  
  225. NET_API_STATUS NET_API_FUNCTION
  226. NetReplImportDirDel (
  227.     IN LPCWSTR servername OPTIONAL,
  228.     IN LPCWSTR dirname
  229.     );
  230.  
  231. NET_API_STATUS NET_API_FUNCTION
  232. NetReplImportDirEnum (
  233.     IN LPCWSTR servername OPTIONAL,
  234.     IN DWORD level,
  235.     OUT LPBYTE * bufptr,
  236.     IN DWORD prefmaxlen,
  237.     OUT LPDWORD entriesread,
  238.     OUT LPDWORD totalentries,
  239.     IN OUT LPDWORD resumehandle OPTIONAL
  240.     );
  241.  
  242. NET_API_STATUS NET_API_FUNCTION
  243. NetReplImportDirGetInfo (
  244.     IN LPCWSTR servername OPTIONAL,
  245.     IN LPCWSTR dirname,
  246.     IN DWORD level,
  247.     OUT LPBYTE * bufptr
  248.     );
  249.  
  250. NET_API_STATUS NET_API_FUNCTION
  251. NetReplImportDirLock (
  252.     IN LPCWSTR servername OPTIONAL,
  253.     IN LPCWSTR dirname
  254.     );
  255.  
  256.  
  257. NET_API_STATUS NET_API_FUNCTION
  258. NetReplImportDirUnlock (
  259.     IN LPCWSTR servername OPTIONAL,
  260.     IN LPCWSTR dirname,
  261.     IN DWORD unlockforce
  262.     );
  263.  
  264.  
  265. #define REPL_STATE_OK                   0
  266. #define REPL_STATE_NO_MASTER            1
  267. #define REPL_STATE_NO_SYNC              2
  268. #define REPL_STATE_NEVER_REPLICATED     3
  269.  
  270.  
  271. #ifdef __cplusplus
  272. }
  273. #endif
  274.  
  275. #endif //_LMREPL_
  276.