~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to packages/extra/winunits/jwalmuse.pas

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{******************************************************************************}
2
 
{                                                                              }
3
 
{ Lan Manager Use API interface Unit for Object Pascal                         }
4
 
{                                                                              }
5
 
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
6
 
{ Corporation. All Rights Reserved.                                            }
7
 
{                                                                              }
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).               }
11
 
{                                                                              }
12
 
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
13
 
{ Marcel van Brakel. All Rights Reserved.                                      }
14
 
{                                                                              }
15
 
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
16
 
{                                                                              }
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              }
19
 
{                                                                              }
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                                      }
24
 
{                                                                              }
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.    }
28
 
{                                                                              }
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.          }
38
 
{                                                                              }
39
 
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
40
 
{                                                                              }
41
 
{******************************************************************************}
42
 
 
43
 
// $Id: jwalmuse.pas,v 1.1 2005/04/04 07:56:10 marco Exp $
44
 
 
45
 
unit JwaLmUse;
46
 
 
47
 
{$WEAKPACKAGEUNIT}
48
 
 
49
 
{$HPPEMIT ''}
50
 
{$HPPEMIT '#include "lmuse.h"'}
51
 
{$HPPEMIT ''}
52
 
 
53
 
{$I jediapilib.inc}
54
 
 
55
 
interface
56
 
 
57
 
uses
58
 
  JwaLmCons, JwaWinType;
59
 
 
60
 
//
61
 
// Function Prototypes
62
 
//
63
 
 
64
 
function NetUseAdd(UncServerName: LMSTR; Level: DWORD; Buf: LPBYTE; ParmError: LPDWORD): NET_API_STATUS; stdcall;
65
 
{$EXTERNALSYM NetUseAdd}
66
 
 
67
 
function NetUseDel(UncServerName: LMSTR; UseName: LMSTR; ForceCond: DWORD): NET_API_STATUS; stdcall;
68
 
{$EXTERNALSYM NetUseDel}
69
 
 
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}
72
 
 
73
 
function NetUseGetInfo(UncServerName: LMSTR; UseName: LMSTR; Level: DWORD; var BufPtr: LPBYTE): NET_API_STATUS; stdcall;
74
 
{$EXTERNALSYM NetUseGetInfo}
75
 
 
76
 
//
77
 
//  Data Structures
78
 
//
79
 
 
80
 
type
81
 
  _USE_INFO_0 = record
82
 
    ui0_local: LMSTR;
83
 
    ui0_remote: LMSTR;
84
 
  end;
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;
94
 
 
95
 
  _USE_INFO_1 = record
96
 
    ui1_local: LMSTR;
97
 
    ui1_remote: LMSTR;
98
 
    ui1_password: LMSTR;
99
 
    ui1_status: DWORD;
100
 
    ui1_asg_type: DWORD;
101
 
    ui1_refcount: DWORD;
102
 
    ui1_usecount: DWORD;
103
 
  end;
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;
113
 
 
114
 
  _USE_INFO_2 = record
115
 
    ui2_local: LMSTR;
116
 
    ui2_remote: LMSTR;
117
 
    ui2_password: LMSTR;
118
 
    ui2_status: DWORD;
119
 
    ui2_asg_type: DWORD;
120
 
    ui2_refcount: DWORD;
121
 
    ui2_usecount: DWORD;
122
 
    ui2_username: LMSTR;
123
 
    ui2_domainname: LMSTR;
124
 
  end;
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;
134
 
 
135
 
  _USE_INFO_3 = record
136
 
    ui3_ui2: USE_INFO_2;
137
 
    ui3_flags: ULONG;
138
 
  end;
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;
148
 
 
149
 
//
150
 
// Special Values and Constants
151
 
//
152
 
 
153
 
//
154
 
// One of these values indicates the parameter within an information
155
 
// structure that is invalid when ERROR_INVALID_PARAMETER is returned by
156
 
// NetUseAdd.
157
 
//
158
 
 
159
 
const
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}
172
 
 
173
 
//
174
 
// Values appearing in the ui1_status field of use_info_1 structure.
175
 
// Note that USE_SESSLOST and USE_DISCONN are synonyms.
176
 
//
177
 
 
178
 
  USE_OK       = 0;
179
 
  {$EXTERNALSYM USE_OK}
180
 
  USE_PAUSED   = 1;
181
 
  {$EXTERNALSYM USE_PAUSED}
182
 
  USE_SESSLOST = 2;
183
 
  {$EXTERNALSYM USE_SESSLOST}
184
 
  USE_DISCONN  = 2;
185
 
  {$EXTERNALSYM USE_DISCONN}
186
 
  USE_NETERR   = 3;
187
 
  {$EXTERNALSYM USE_NETERR}
188
 
  USE_CONN     = 4;
189
 
  {$EXTERNALSYM USE_CONN}
190
 
  USE_RECONN   = 5;
191
 
  {$EXTERNALSYM USE_RECONN}
192
 
 
193
 
//
194
 
// Values of the ui1_asg_type field of use_info_1 structure
195
 
//
196
 
 
197
 
  USE_WILDCARD = DWORD(-1);
198
 
  {$EXTERNALSYM USE_WILDCARD}
199
 
  USE_DISKDEV  = 0;
200
 
  {$EXTERNALSYM USE_DISKDEV}
201
 
  USE_SPOOLDEV = 1;
202
 
  {$EXTERNALSYM USE_SPOOLDEV}
203
 
  USE_CHARDEV  = 2;
204
 
  {$EXTERNALSYM USE_CHARDEV}
205
 
  USE_IPC      = 3;
206
 
  {$EXTERNALSYM USE_IPC}
207
 
 
208
 
//
209
 
// Flags defined in the use_info_3 structure
210
 
//
211
 
 
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}
220
 
 
221
 
implementation
222
 
 
223
 
{$IFDEF DYNAMIC_LINK}
224
 
 
225
 
var
226
 
  _NetUseAdd: Pointer;
227
 
 
228
 
function NetUseAdd;
229
 
begin
230
 
  GetProcedureAddress(_NetUseAdd, netapi32, 'NetUseAdd');
231
 
  asm
232
 
        MOV     ESP, EBP
233
 
        POP     EBP
234
 
        JMP     [_NetUseAdd]
235
 
  end;
236
 
end;
237
 
 
238
 
var
239
 
  _NetUseDel: Pointer;
240
 
 
241
 
function NetUseDel;
242
 
begin
243
 
  GetProcedureAddress(_NetUseDel, netapi32, 'NetUseDel');
244
 
  asm
245
 
        MOV     ESP, EBP
246
 
        POP     EBP
247
 
        JMP     [_NetUseDel]
248
 
  end;
249
 
end;
250
 
 
251
 
var
252
 
  _NetUseEnum: Pointer;
253
 
 
254
 
function NetUseEnum;
255
 
begin
256
 
  GetProcedureAddress(_NetUseEnum, netapi32, 'NetUseEnum');
257
 
  asm
258
 
        MOV     ESP, EBP
259
 
        POP     EBP
260
 
        JMP     [_NetUseEnum]
261
 
  end;
262
 
end;
263
 
 
264
 
var
265
 
  _NetUseGetInfo: Pointer;
266
 
 
267
 
function NetUseGetInfo;
268
 
begin
269
 
  GetProcedureAddress(_NetUseGetInfo, netapi32, 'NetUseGetInfo');
270
 
  asm
271
 
        MOV     ESP, EBP
272
 
        POP     EBP
273
 
        JMP     [_NetUseGetInfo]
274
 
  end;
275
 
end;
276
 
 
277
 
{$ELSE}
278
 
 
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';
283
 
 
284
 
{$ENDIF DYNAMIC_LINK}
285
 
 
286
 
end.
 
1
{******************************************************************************}
 
2
{                                                                              }
 
3
{ Lan Manager Use API interface Unit for Object Pascal                         }
 
4
{                                                                              }
 
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
 
6
{ Corporation. All Rights Reserved.                                            }
 
7
{                                                                              }
 
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).               }
 
11
{                                                                              }
 
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
 
13
{ Marcel van Brakel. All Rights Reserved.                                      }
 
14
{                                                                              }
 
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
 
16
{                                                                              }
 
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              }
 
19
{                                                                              }
 
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                                      }
 
24
{                                                                              }
 
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.    }
 
28
{                                                                              }
 
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.          }
 
38
{                                                                              }
 
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
 
40
{                                                                              }
 
41
{******************************************************************************}
 
42
 
 
43
 
 
44
unit JwaLmUse;
 
45
 
 
46
{$WEAKPACKAGEUNIT}
 
47
 
 
48
{$HPPEMIT ''}
 
49
{$HPPEMIT '#include "lmuse.h"'}
 
50
{$HPPEMIT ''}
 
51
 
 
52
{$I jediapilib.inc}
 
53
 
 
54
interface
 
55
 
 
56
uses
 
57
  JwaLmCons, JwaWinType;
 
58
 
 
59
//
 
60
// Function Prototypes
 
61
//
 
62
 
 
63
function NetUseAdd(UncServerName: LMSTR; Level: DWORD; Buf: LPBYTE; ParmError: LPDWORD): NET_API_STATUS; stdcall;
 
64
{$EXTERNALSYM NetUseAdd}
 
65
 
 
66
function NetUseDel(UncServerName: LMSTR; UseName: LMSTR; ForceCond: DWORD): NET_API_STATUS; stdcall;
 
67
{$EXTERNALSYM NetUseDel}
 
68
 
 
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}
 
71
 
 
72
function NetUseGetInfo(UncServerName: LMSTR; UseName: LMSTR; Level: DWORD; var BufPtr: LPBYTE): NET_API_STATUS; stdcall;
 
73
{$EXTERNALSYM NetUseGetInfo}
 
74
 
 
75
//
 
76
//  Data Structures
 
77
//
 
78
 
 
79
type
 
80
  _USE_INFO_0 = record
 
81
    ui0_local: LMSTR;
 
82
    ui0_remote: LMSTR;
 
83
  end;
 
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;
 
93
 
 
94
  _USE_INFO_1 = record
 
95
    ui1_local: LMSTR;
 
96
    ui1_remote: LMSTR;
 
97
    ui1_password: LMSTR;
 
98
    ui1_status: DWORD;
 
99
    ui1_asg_type: DWORD;
 
100
    ui1_refcount: DWORD;
 
101
    ui1_usecount: DWORD;
 
102
  end;
 
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;
 
112
 
 
113
  _USE_INFO_2 = record
 
114
    ui2_local: LMSTR;
 
115
    ui2_remote: LMSTR;
 
116
    ui2_password: LMSTR;
 
117
    ui2_status: DWORD;
 
118
    ui2_asg_type: DWORD;
 
119
    ui2_refcount: DWORD;
 
120
    ui2_usecount: DWORD;
 
121
    ui2_username: LMSTR;
 
122
    ui2_domainname: LMSTR;
 
123
  end;
 
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;
 
133
 
 
134
  _USE_INFO_3 = record
 
135
    ui3_ui2: USE_INFO_2;
 
136
    ui3_flags: ULONG;
 
137
  end;
 
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;
 
147
 
 
148
//
 
149
// Special Values and Constants
 
150
//
 
151
 
 
152
//
 
153
// One of these values indicates the parameter within an information
 
154
// structure that is invalid when ERROR_INVALID_PARAMETER is returned by
 
155
// NetUseAdd.
 
156
//
 
157
 
 
158
const
 
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}
 
171
 
 
172
//
 
173
// Values appearing in the ui1_status field of use_info_1 structure.
 
174
// Note that USE_SESSLOST and USE_DISCONN are synonyms.
 
175
//
 
176
 
 
177
  USE_OK       = 0;
 
178
  {$EXTERNALSYM USE_OK}
 
179
  USE_PAUSED   = 1;
 
180
  {$EXTERNALSYM USE_PAUSED}
 
181
  USE_SESSLOST = 2;
 
182
  {$EXTERNALSYM USE_SESSLOST}
 
183
  USE_DISCONN  = 2;
 
184
  {$EXTERNALSYM USE_DISCONN}
 
185
  USE_NETERR   = 3;
 
186
  {$EXTERNALSYM USE_NETERR}
 
187
  USE_CONN     = 4;
 
188
  {$EXTERNALSYM USE_CONN}
 
189
  USE_RECONN   = 5;
 
190
  {$EXTERNALSYM USE_RECONN}
 
191
 
 
192
//
 
193
// Values of the ui1_asg_type field of use_info_1 structure
 
194
//
 
195
 
 
196
  USE_WILDCARD = DWORD(-1);
 
197
  {$EXTERNALSYM USE_WILDCARD}
 
198
  USE_DISKDEV  = 0;
 
199
  {$EXTERNALSYM USE_DISKDEV}
 
200
  USE_SPOOLDEV = 1;
 
201
  {$EXTERNALSYM USE_SPOOLDEV}
 
202
  USE_CHARDEV  = 2;
 
203
  {$EXTERNALSYM USE_CHARDEV}
 
204
  USE_IPC      = 3;
 
205
  {$EXTERNALSYM USE_IPC}
 
206
 
 
207
//
 
208
// Flags defined in the use_info_3 structure
 
209
//
 
210
 
 
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}
 
219
 
 
220
implementation
 
221
 
 
222
{$IFDEF DYNAMIC_LINK}
 
223
 
 
224
var
 
225
  _NetUseAdd: Pointer;
 
226
 
 
227
function NetUseAdd;
 
228
begin
 
229
  GetProcedureAddress(_NetUseAdd, netapi32, 'NetUseAdd');
 
230
  asm
 
231
        MOV     ESP, EBP
 
232
        POP     EBP
 
233
        JMP     [_NetUseAdd]
 
234
  end;
 
235
end;
 
236
 
 
237
var
 
238
  _NetUseDel: Pointer;
 
239
 
 
240
function NetUseDel;
 
241
begin
 
242
  GetProcedureAddress(_NetUseDel, netapi32, 'NetUseDel');
 
243
  asm
 
244
        MOV     ESP, EBP
 
245
        POP     EBP
 
246
        JMP     [_NetUseDel]
 
247
  end;
 
248
end;
 
249
 
 
250
var
 
251
  _NetUseEnum: Pointer;
 
252
 
 
253
function NetUseEnum;
 
254
begin
 
255
  GetProcedureAddress(_NetUseEnum, netapi32, 'NetUseEnum');
 
256
  asm
 
257
        MOV     ESP, EBP
 
258
        POP     EBP
 
259
        JMP     [_NetUseEnum]
 
260
  end;
 
261
end;
 
262
 
 
263
var
 
264
  _NetUseGetInfo: Pointer;
 
265
 
 
266
function NetUseGetInfo;
 
267
begin
 
268
  GetProcedureAddress(_NetUseGetInfo, netapi32, 'NetUseGetInfo');
 
269
  asm
 
270
        MOV     ESP, EBP
 
271
        POP     EBP
 
272
        JMP     [_NetUseGetInfo]
 
273
  end;
 
274
end;
 
275
 
 
276
{$ELSE}
 
277
 
 
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';
 
282
 
 
283
{$ENDIF DYNAMIC_LINK}
 
284
 
 
285
end.