Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
3.9 KiB

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