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

  1. /*++ BUILD Version: 0001    // Increment this if a change has global effects
  2.  
  3. Copyright 1991-1998 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     lmuse.c
  8.  
  9. Abstract:
  10.  
  11.     This file contains structures, function prototypes, and definitions
  12.     for the NetUse API.
  13.  
  14.  
  15. Environment:
  16.  
  17.     User Mode - Win32
  18.     Portable to any flat, 32-bit environment.  (Uses Win32 typedefs.)
  19.     Requires ANSI C extensions: slash-slash comments, long external names.
  20.  
  21. Notes:
  22.  
  23.     You must include NETCONS.H before this file, since this file depends
  24.     on values defined in NETCONS.H.
  25.  
  26.  
  27. --*/
  28.  
  29. #ifndef _LMUSE_
  30. #define _LMUSE_
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #include <lmuseflg.h>                   // Deletion force level flags
  37.  
  38. //
  39. // Function Prototypes
  40. //
  41.  
  42. NET_API_STATUS NET_API_FUNCTION
  43. NetUseAdd (
  44.     IN LPTSTR UncServerName OPTIONAL,
  45.     IN DWORD Level,
  46.     IN LPBYTE Buf,
  47.     OUT LPDWORD ParmError OPTIONAL
  48.     );
  49.  
  50. NET_API_STATUS NET_API_FUNCTION
  51. NetUseDel (
  52.     IN LPTSTR UncServerName OPTIONAL,
  53.     IN LPTSTR UseName,
  54.     IN DWORD ForceCond
  55.     );
  56.  
  57. NET_API_STATUS NET_API_FUNCTION
  58. NetUseEnum (
  59.     IN LPTSTR UncServerName OPTIONAL,
  60.     IN DWORD Level,
  61.     OUT LPBYTE *BufPtr,
  62.     IN DWORD PreferedMaximumSize,
  63.     OUT LPDWORD EntriesRead,
  64.     OUT LPDWORD TotalEntries,
  65.     IN OUT LPDWORD ResumeHandle
  66.     );
  67.  
  68. NET_API_STATUS NET_API_FUNCTION
  69. NetUseGetInfo (
  70.     IN LPTSTR UncServerName OPTIONAL,
  71.     IN LPTSTR UseName,
  72.     IN DWORD Level,
  73.     OUT LPBYTE *BufPtr
  74.     );
  75.  
  76. //
  77. //  Data Structures
  78. //
  79.  
  80. typedef struct _USE_INFO_0 {
  81.     LPTSTR  ui0_local;
  82.     LPTSTR  ui0_remote;
  83. }USE_INFO_0, *PUSE_INFO_0, *LPUSE_INFO_0;
  84.  
  85. typedef struct _USE_INFO_1 {
  86.     LPTSTR  ui1_local;
  87.     LPTSTR  ui1_remote;
  88.     LPTSTR  ui1_password;
  89.     DWORD   ui1_status;
  90.     DWORD   ui1_asg_type;
  91.     DWORD   ui1_refcount;
  92.     DWORD   ui1_usecount;
  93. }USE_INFO_1, *PUSE_INFO_1, *LPUSE_INFO_1;
  94.  
  95. typedef struct _USE_INFO_2 {
  96.     LPTSTR   ui2_local;
  97.     LPTSTR   ui2_remote;
  98.     LPTSTR   ui2_password;
  99.     DWORD    ui2_status;
  100.     DWORD    ui2_asg_type;
  101.     DWORD    ui2_refcount;
  102.     DWORD    ui2_usecount;
  103.     LPTSTR   ui2_username;
  104.     LPTSTR   ui2_domainname;
  105. }USE_INFO_2, *PUSE_INFO_2, *LPUSE_INFO_2;
  106.  
  107. typedef struct _USE_INFO_3 {
  108.     USE_INFO_2 ui3_ui2;
  109.     ULONG      ui3_flags;
  110. } USE_INFO_3, *PUSE_INFO_3, *LPUSE_INFO_3;
  111.  
  112.  
  113. //
  114. // Special Values and Constants
  115. //
  116.  
  117. //
  118. // One of these values indicates the parameter within an information
  119. // structure that is invalid when ERROR_INVALID_PARAMETER is returned by
  120. // NetUseAdd.
  121. //
  122.  
  123. #define USE_LOCAL_PARMNUM       1
  124. #define USE_REMOTE_PARMNUM      2
  125. #define USE_PASSWORD_PARMNUM    3
  126. #define USE_ASGTYPE_PARMNUM     4
  127. #define USE_USERNAME_PARMNUM    5
  128. #define USE_DOMAINNAME_PARMNUM  6
  129.  
  130. //
  131. // Values appearing in the ui1_status field of use_info_1 structure.
  132. // Note that USE_SESSLOST and USE_DISCONN are synonyms.
  133. //
  134.  
  135. #define USE_OK                  0
  136. #define USE_PAUSED              1
  137. #define USE_SESSLOST            2
  138. #define USE_DISCONN             2
  139. #define USE_NETERR              3
  140. #define USE_CONN                4
  141. #define USE_RECONN              5
  142.  
  143.  
  144. //
  145. // Values of the ui1_asg_type field of use_info_1 structure
  146. //
  147.  
  148. #define USE_WILDCARD            ( (DWORD) (-1) )
  149. #define USE_DISKDEV             0
  150. #define USE_SPOOLDEV            1
  151. #define USE_CHARDEV             2
  152. #define USE_IPC                 3
  153.  
  154. //
  155. // Flags defined in the use_info_3 structure
  156. //
  157.  
  158. #define CREATE_NO_CONNECT 0x1        // creation flags
  159.  
  160. #ifdef __cplusplus
  161. }
  162. #endif
  163.  
  164. #endif // _LMUSE_
  165.