1
{******************************************************************************}
3
{ Lan Manager Use API interface Unit for Object Pascal }
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
6
{ Corporation. All Rights Reserved. }
8
{ The original file is: lmuse.h, released November 2001. The original Pascal }
9
{ code is: LmUse.pas, released Februari 2002. The initial developer of the }
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
13
{ Marcel van Brakel. All Rights Reserved. }
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
17
{ You may retrieve the latest version of this file at the Project JEDI }
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net }
20
{ The contents of this file are used with permission, subject to the Mozilla }
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
22
{ in compliance with the License. You may obtain a copy of the License at }
23
{ http://www.mozilla.org/MPL/MPL-1.1.html }
25
{ Software distributed under the License is distributed on an "AS IS" basis, }
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27
{ the specific language governing rights and limitations under the License. }
29
{ Alternatively, the contents of this file may be used under the terms of the }
30
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
31
{ provisions of the LGPL License are applicable instead of those above. }
32
{ If you wish to allow use of your version of this file only under the terms }
33
{ of the LGPL License and not to allow others to use your version of this file }
34
{ under the MPL, indicate your decision by deleting the provisions above and }
35
{ replace them with the notice and other provisions required by the LGPL }
36
{ License. If you do not delete the provisions above, a recipient may use }
37
{ your version of this file under either the MPL or the LGPL License. }
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
41
{******************************************************************************}
43
// $Id: jwalmuse.pas,v 1.1 2005/04/04 07:56:10 marco Exp $
50
{$HPPEMIT '#include "lmuse.h"'}
58
JwaLmCons, JwaWinType;
61
// Function Prototypes
64
function NetUseAdd(UncServerName: LMSTR; Level: DWORD; Buf: LPBYTE; ParmError: LPDWORD): NET_API_STATUS; stdcall;
65
{$EXTERNALSYM NetUseAdd}
67
function NetUseDel(UncServerName: LMSTR; UseName: LMSTR; ForceCond: DWORD): NET_API_STATUS; stdcall;
68
{$EXTERNALSYM NetUseDel}
70
function NetUseEnum(UncServerName: LMSTR; Level: DWORD; var BufPtr: LPBYTE; PreferedMaximumSize: DWORD; EntriesRead: LPDWORD; TotalEntries: LPDWORD; ResumeHandle: LPDWORD): NET_API_STATUS; stdcall;
71
{$EXTERNALSYM NetUseEnum}
73
function NetUseGetInfo(UncServerName: LMSTR; UseName: LMSTR; Level: DWORD; var BufPtr: LPBYTE): NET_API_STATUS; stdcall;
74
{$EXTERNALSYM NetUseGetInfo}
85
{$EXTERNALSYM _USE_INFO_0}
86
USE_INFO_0 = _USE_INFO_0;
87
{$EXTERNALSYM USE_INFO_0}
88
PUSE_INFO_0 = ^USE_INFO_0;
89
{$EXTERNALSYM PUSE_INFO_0}
90
LPUSE_INFO_0 = ^USE_INFO_0;
91
{$EXTERNALSYM LPUSE_INFO_0}
92
TUseInfo0 = USE_INFO_0;
93
PUseInfo0 = PUSE_INFO_0;
104
{$EXTERNALSYM _USE_INFO_1}
105
USE_INFO_1 = _USE_INFO_1;
106
{$EXTERNALSYM USE_INFO_1}
107
PUSE_INFO_1 = ^USE_INFO_1;
108
{$EXTERNALSYM PUSE_INFO_1}
109
LPUSE_INFO_1 = ^USE_INFO_1;
110
{$EXTERNALSYM LPUSE_INFO_1}
111
TUseInfo1 = USE_INFO_1;
112
PUseInfo1 = PUSE_INFO_1;
123
ui2_domainname: LMSTR;
125
{$EXTERNALSYM _USE_INFO_2}
126
USE_INFO_2 = _USE_INFO_2;
127
{$EXTERNALSYM USE_INFO_2}
128
PUSE_INFO_2 = ^USE_INFO_2;
129
{$EXTERNALSYM PUSE_INFO_2}
130
LPUSE_INFO_2 = ^USE_INFO_2;
131
{$EXTERNALSYM LPUSE_INFO_2}
132
TUseInfo2 = USE_INFO_2;
133
PUseInfo2 = PUSE_INFO_2;
139
{$EXTERNALSYM _USE_INFO_3}
140
USE_INFO_3 = _USE_INFO_3;
141
{$EXTERNALSYM USE_INFO_3}
142
PUSE_INFO_3 = ^USE_INFO_3;
143
{$EXTERNALSYM PUSE_INFO_3}
144
LPUSE_INFO_3 = ^USE_INFO_3;
145
{$EXTERNALSYM LPUSE_INFO_3}
146
TUseInfo3 = USE_INFO_3;
147
PUseInfo3 = PUSE_INFO_3;
150
// Special Values and Constants
154
// One of these values indicates the parameter within an information
155
// structure that is invalid when ERROR_INVALID_PARAMETER is returned by
160
USE_LOCAL_PARMNUM = 1;
161
{$EXTERNALSYM USE_LOCAL_PARMNUM}
162
USE_REMOTE_PARMNUM = 2;
163
{$EXTERNALSYM USE_REMOTE_PARMNUM}
164
USE_PASSWORD_PARMNUM = 3;
165
{$EXTERNALSYM USE_PASSWORD_PARMNUM}
166
USE_ASGTYPE_PARMNUM = 4;
167
{$EXTERNALSYM USE_ASGTYPE_PARMNUM}
168
USE_USERNAME_PARMNUM = 5;
169
{$EXTERNALSYM USE_USERNAME_PARMNUM}
170
USE_DOMAINNAME_PARMNUM = 6;
171
{$EXTERNALSYM USE_DOMAINNAME_PARMNUM}
174
// Values appearing in the ui1_status field of use_info_1 structure.
175
// Note that USE_SESSLOST and USE_DISCONN are synonyms.
179
{$EXTERNALSYM USE_OK}
181
{$EXTERNALSYM USE_PAUSED}
183
{$EXTERNALSYM USE_SESSLOST}
185
{$EXTERNALSYM USE_DISCONN}
187
{$EXTERNALSYM USE_NETERR}
189
{$EXTERNALSYM USE_CONN}
191
{$EXTERNALSYM USE_RECONN}
194
// Values of the ui1_asg_type field of use_info_1 structure
197
USE_WILDCARD = DWORD(-1);
198
{$EXTERNALSYM USE_WILDCARD}
200
{$EXTERNALSYM USE_DISKDEV}
202
{$EXTERNALSYM USE_SPOOLDEV}
204
{$EXTERNALSYM USE_CHARDEV}
206
{$EXTERNALSYM USE_IPC}
209
// Flags defined in the use_info_3 structure
212
CREATE_NO_CONNECT = $1; // creation flags
213
{$EXTERNALSYM CREATE_NO_CONNECT}
214
CREATE_BYPASS_CSC = $2; // force connection to server, bypassing CSC
215
{$EXTERNALSYM CREATE_BYPASS_CSC}
216
// all ops on this connection go to the server,
217
// never to the cache
218
USE_DEFAULT_CREDENTIALS = $4; // No explicit credentials passed to NetUseAdd
219
{$EXTERNALSYM USE_DEFAULT_CREDENTIALS}
223
{$IFDEF DYNAMIC_LINK}
230
GetProcedureAddress(_NetUseAdd, netapi32, 'NetUseAdd');
243
GetProcedureAddress(_NetUseDel, netapi32, 'NetUseDel');
252
_NetUseEnum: Pointer;
256
GetProcedureAddress(_NetUseEnum, netapi32, 'NetUseEnum');
265
_NetUseGetInfo: Pointer;
267
function NetUseGetInfo;
269
GetProcedureAddress(_NetUseGetInfo, netapi32, 'NetUseGetInfo');
279
function NetUseAdd; external netapi32 name 'NetUseAdd';
280
function NetUseDel; external netapi32 name 'NetUseDel';
281
function NetUseEnum; external netapi32 name 'NetUseEnum';
282
function NetUseGetInfo; external netapi32 name 'NetUseGetInfo';
284
{$ENDIF DYNAMIC_LINK}
1
{******************************************************************************}
3
{ Lan Manager Use API interface Unit for Object Pascal }
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
6
{ Corporation. All Rights Reserved. }
8
{ The original file is: lmuse.h, released November 2001. The original Pascal }
9
{ code is: LmUse.pas, released Februari 2002. The initial developer of the }
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
13
{ Marcel van Brakel. All Rights Reserved. }
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
17
{ You may retrieve the latest version of this file at the Project JEDI }
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net }
20
{ The contents of this file are used with permission, subject to the Mozilla }
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
22
{ in compliance with the License. You may obtain a copy of the License at }
23
{ http://www.mozilla.org/MPL/MPL-1.1.html }
25
{ Software distributed under the License is distributed on an "AS IS" basis, }
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27
{ the specific language governing rights and limitations under the License. }
29
{ Alternatively, the contents of this file may be used under the terms of the }
30
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
31
{ provisions of the LGPL License are applicable instead of those above. }
32
{ If you wish to allow use of your version of this file only under the terms }
33
{ of the LGPL License and not to allow others to use your version of this file }
34
{ under the MPL, indicate your decision by deleting the provisions above and }
35
{ replace them with the notice and other provisions required by the LGPL }
36
{ License. If you do not delete the provisions above, a recipient may use }
37
{ your version of this file under either the MPL or the LGPL License. }
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
41
{******************************************************************************}
49
{$HPPEMIT '#include "lmuse.h"'}
57
JwaLmCons, JwaWinType;
60
// Function Prototypes
63
function NetUseAdd(UncServerName: LMSTR; Level: DWORD; Buf: LPBYTE; ParmError: LPDWORD): NET_API_STATUS; stdcall;
64
{$EXTERNALSYM NetUseAdd}
66
function NetUseDel(UncServerName: LMSTR; UseName: LMSTR; ForceCond: DWORD): NET_API_STATUS; stdcall;
67
{$EXTERNALSYM NetUseDel}
69
function NetUseEnum(UncServerName: LMSTR; Level: DWORD; var BufPtr: LPBYTE; PreferedMaximumSize: DWORD; EntriesRead: LPDWORD; TotalEntries: LPDWORD; ResumeHandle: LPDWORD): NET_API_STATUS; stdcall;
70
{$EXTERNALSYM NetUseEnum}
72
function NetUseGetInfo(UncServerName: LMSTR; UseName: LMSTR; Level: DWORD; var BufPtr: LPBYTE): NET_API_STATUS; stdcall;
73
{$EXTERNALSYM NetUseGetInfo}
84
{$EXTERNALSYM _USE_INFO_0}
85
USE_INFO_0 = _USE_INFO_0;
86
{$EXTERNALSYM USE_INFO_0}
87
PUSE_INFO_0 = ^USE_INFO_0;
88
{$EXTERNALSYM PUSE_INFO_0}
89
LPUSE_INFO_0 = ^USE_INFO_0;
90
{$EXTERNALSYM LPUSE_INFO_0}
91
TUseInfo0 = USE_INFO_0;
92
PUseInfo0 = PUSE_INFO_0;
103
{$EXTERNALSYM _USE_INFO_1}
104
USE_INFO_1 = _USE_INFO_1;
105
{$EXTERNALSYM USE_INFO_1}
106
PUSE_INFO_1 = ^USE_INFO_1;
107
{$EXTERNALSYM PUSE_INFO_1}
108
LPUSE_INFO_1 = ^USE_INFO_1;
109
{$EXTERNALSYM LPUSE_INFO_1}
110
TUseInfo1 = USE_INFO_1;
111
PUseInfo1 = PUSE_INFO_1;
122
ui2_domainname: LMSTR;
124
{$EXTERNALSYM _USE_INFO_2}
125
USE_INFO_2 = _USE_INFO_2;
126
{$EXTERNALSYM USE_INFO_2}
127
PUSE_INFO_2 = ^USE_INFO_2;
128
{$EXTERNALSYM PUSE_INFO_2}
129
LPUSE_INFO_2 = ^USE_INFO_2;
130
{$EXTERNALSYM LPUSE_INFO_2}
131
TUseInfo2 = USE_INFO_2;
132
PUseInfo2 = PUSE_INFO_2;
138
{$EXTERNALSYM _USE_INFO_3}
139
USE_INFO_3 = _USE_INFO_3;
140
{$EXTERNALSYM USE_INFO_3}
141
PUSE_INFO_3 = ^USE_INFO_3;
142
{$EXTERNALSYM PUSE_INFO_3}
143
LPUSE_INFO_3 = ^USE_INFO_3;
144
{$EXTERNALSYM LPUSE_INFO_3}
145
TUseInfo3 = USE_INFO_3;
146
PUseInfo3 = PUSE_INFO_3;
149
// Special Values and Constants
153
// One of these values indicates the parameter within an information
154
// structure that is invalid when ERROR_INVALID_PARAMETER is returned by
159
USE_LOCAL_PARMNUM = 1;
160
{$EXTERNALSYM USE_LOCAL_PARMNUM}
161
USE_REMOTE_PARMNUM = 2;
162
{$EXTERNALSYM USE_REMOTE_PARMNUM}
163
USE_PASSWORD_PARMNUM = 3;
164
{$EXTERNALSYM USE_PASSWORD_PARMNUM}
165
USE_ASGTYPE_PARMNUM = 4;
166
{$EXTERNALSYM USE_ASGTYPE_PARMNUM}
167
USE_USERNAME_PARMNUM = 5;
168
{$EXTERNALSYM USE_USERNAME_PARMNUM}
169
USE_DOMAINNAME_PARMNUM = 6;
170
{$EXTERNALSYM USE_DOMAINNAME_PARMNUM}
173
// Values appearing in the ui1_status field of use_info_1 structure.
174
// Note that USE_SESSLOST and USE_DISCONN are synonyms.
178
{$EXTERNALSYM USE_OK}
180
{$EXTERNALSYM USE_PAUSED}
182
{$EXTERNALSYM USE_SESSLOST}
184
{$EXTERNALSYM USE_DISCONN}
186
{$EXTERNALSYM USE_NETERR}
188
{$EXTERNALSYM USE_CONN}
190
{$EXTERNALSYM USE_RECONN}
193
// Values of the ui1_asg_type field of use_info_1 structure
196
USE_WILDCARD = DWORD(-1);
197
{$EXTERNALSYM USE_WILDCARD}
199
{$EXTERNALSYM USE_DISKDEV}
201
{$EXTERNALSYM USE_SPOOLDEV}
203
{$EXTERNALSYM USE_CHARDEV}
205
{$EXTERNALSYM USE_IPC}
208
// Flags defined in the use_info_3 structure
211
CREATE_NO_CONNECT = $1; // creation flags
212
{$EXTERNALSYM CREATE_NO_CONNECT}
213
CREATE_BYPASS_CSC = $2; // force connection to server, bypassing CSC
214
{$EXTERNALSYM CREATE_BYPASS_CSC}
215
// all ops on this connection go to the server,
216
// never to the cache
217
USE_DEFAULT_CREDENTIALS = $4; // No explicit credentials passed to NetUseAdd
218
{$EXTERNALSYM USE_DEFAULT_CREDENTIALS}
222
{$IFDEF DYNAMIC_LINK}
229
GetProcedureAddress(_NetUseAdd, netapi32, 'NetUseAdd');
242
GetProcedureAddress(_NetUseDel, netapi32, 'NetUseDel');
251
_NetUseEnum: Pointer;
255
GetProcedureAddress(_NetUseEnum, netapi32, 'NetUseEnum');
264
_NetUseGetInfo: Pointer;
266
function NetUseGetInfo;
268
GetProcedureAddress(_NetUseGetInfo, netapi32, 'NetUseGetInfo');
278
function NetUseAdd; external netapi32 name 'NetUseAdd';
279
function NetUseDel; external netapi32 name 'NetUseDel';
280
function NetUseEnum; external netapi32 name 'NetUseEnum';
281
function NetUseGetInfo; external netapi32 name 'NetUseGetInfo';
283
{$ENDIF DYNAMIC_LINK}