home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / lmuse.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  3.9 KB  |  175 lines

  1. /*++ BUILD Version: 0001    // Increment this if a change has global effects
  2.  
  3. Copyright (c) 1991-1999  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. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  31. #define _LMUSE_
  32.  
  33. #if _MSC_VER > 1000
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #include <lmcons.h>
  42. #include <lmuseflg.h>                   // Deletion force level flags
  43.  
  44. //
  45. // Function Prototypes
  46. //
  47.  
  48. NET_API_STATUS NET_API_FUNCTION
  49. NetUseAdd (
  50.     IN LMSTR  UncServerName OPTIONAL,
  51.     IN DWORD Level,
  52.     IN LPBYTE Buf,
  53.     OUT LPDWORD ParmError OPTIONAL
  54.     );
  55.  
  56. NET_API_STATUS NET_API_FUNCTION
  57. NetUseDel (
  58.     IN LMSTR  UncServerName OPTIONAL,
  59.     IN LMSTR  UseName,
  60.     IN DWORD ForceCond
  61.     );
  62.  
  63. NET_API_STATUS NET_API_FUNCTION
  64. NetUseEnum (
  65.     IN LMSTR  UncServerName OPTIONAL,
  66.     IN DWORD Level,
  67.     OUT LPBYTE *BufPtr,
  68.     IN DWORD PreferedMaximumSize,
  69.     OUT LPDWORD EntriesRead,
  70.     OUT LPDWORD TotalEntries,
  71.     IN OUT LPDWORD ResumeHandle
  72.     );
  73.  
  74. NET_API_STATUS NET_API_FUNCTION
  75. NetUseGetInfo (
  76.     IN LMSTR  UncServerName OPTIONAL,
  77.     IN LMSTR  UseName,
  78.     IN DWORD Level,
  79.     OUT LPBYTE *BufPtr
  80.     );
  81.  
  82. //
  83. //  Data Structures
  84. //
  85.  
  86. typedef struct _USE_INFO_0 {
  87.     LMSTR   ui0_local;
  88.     LMSTR   ui0_remote;
  89. }USE_INFO_0, *PUSE_INFO_0, *LPUSE_INFO_0;
  90.  
  91. typedef struct _USE_INFO_1 {
  92.     LMSTR   ui1_local;
  93.     LMSTR   ui1_remote;
  94.     LMSTR   ui1_password;
  95.     DWORD   ui1_status;
  96.     DWORD   ui1_asg_type;
  97.     DWORD   ui1_refcount;
  98.     DWORD   ui1_usecount;
  99. }USE_INFO_1, *PUSE_INFO_1, *LPUSE_INFO_1;
  100.  
  101. typedef struct _USE_INFO_2 {
  102.     LMSTR    ui2_local;
  103.     LMSTR    ui2_remote;
  104.     LMSTR    ui2_password;
  105.     DWORD    ui2_status;
  106.     DWORD    ui2_asg_type;
  107.     DWORD    ui2_refcount;
  108.     DWORD    ui2_usecount;
  109.     LMSTR    ui2_username;
  110.     LMSTR    ui2_domainname;
  111. }USE_INFO_2, *PUSE_INFO_2, *LPUSE_INFO_2;
  112.  
  113. typedef struct _USE_INFO_3 {
  114.     USE_INFO_2 ui3_ui2;
  115.     ULONG      ui3_flags;
  116. } USE_INFO_3, *PUSE_INFO_3, *LPUSE_INFO_3;
  117.  
  118.  
  119. //
  120. // Special Values and Constants
  121. //
  122.  
  123. //
  124. // One of these values indicates the parameter within an information
  125. // structure that is invalid when ERROR_INVALID_PARAMETER is returned by
  126. // NetUseAdd.
  127. //
  128.  
  129. #define USE_LOCAL_PARMNUM       1
  130. #define USE_REMOTE_PARMNUM      2
  131. #define USE_PASSWORD_PARMNUM    3
  132. #define USE_ASGTYPE_PARMNUM     4
  133. #define USE_USERNAME_PARMNUM    5
  134. #define USE_DOMAINNAME_PARMNUM  6
  135.  
  136. //
  137. // Values appearing in the ui1_status field of use_info_1 structure.
  138. // Note that USE_SESSLOST and USE_DISCONN are synonyms.
  139. //
  140.  
  141. #define USE_OK                  0
  142. #define USE_PAUSED              1
  143. #define USE_SESSLOST            2
  144. #define USE_DISCONN             2
  145. #define USE_NETERR              3
  146. #define USE_CONN                4
  147. #define USE_RECONN              5
  148.  
  149.  
  150. //
  151. // Values of the ui1_asg_type field of use_info_1 structure
  152. //
  153.  
  154. #define USE_WILDCARD            ( (DWORD) (-1) )
  155. #define USE_DISKDEV             0
  156. #define USE_SPOOLDEV            1
  157. #define USE_CHARDEV             2
  158. #define USE_IPC                 3
  159.  
  160. //
  161. // Flags defined in the use_info_3 structure
  162. //
  163.  
  164. #define CREATE_NO_CONNECT 0x1        // creation flags
  165. #define CREATE_BYPASS_CSC 0x2        // force connection to server, bypassing CSC
  166.                                      //  all ops on this connection go to the server,
  167.                                      //  never to the cache
  168.  
  169. #ifdef __cplusplus
  170. }
  171. #endif
  172.  
  173. #pragma option pop /*P_O_Pop*/
  174. #endif // _LMUSE_
  175.