~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{******************************************************************************}
 
2
{                                                                              }
 
3
{ Lan Manager DFS 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: lmdfs.h, released November 2001. The original Pascal   }
 
9
{ code is: LmDfs.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: jwalmdfs.pas,v 1.1 2005/04/04 07:56:10 marco Exp $
 
44
 
 
45
unit JwaLmDFS;
 
46
 
 
47
{$WEAKPACKAGEUNIT}
 
48
 
 
49
{$HPPEMIT ''}
 
50
{$HPPEMIT '#include "lmdfs.h"'}
 
51
{$HPPEMIT ''}
 
52
 
 
53
{$I jediapilib.inc}
 
54
 
 
55
interface
 
56
 
 
57
uses
 
58
  JwaLmCons, JwaWinType;
 
59
 
 
60
//
 
61
// DFS Volume state
 
62
//
 
63
 
 
64
const
 
65
  DFS_VOLUME_STATES             = $F;
 
66
  {$EXTERNALSYM DFS_VOLUME_STATES}
 
67
 
 
68
  DFS_VOLUME_STATE_OK           = 1;
 
69
  {$EXTERNALSYM DFS_VOLUME_STATE_OK}
 
70
  DFS_VOLUME_STATE_INCONSISTENT = 2;
 
71
  {$EXTERNALSYM DFS_VOLUME_STATE_INCONSISTENT}
 
72
  DFS_VOLUME_STATE_OFFLINE      = 3;
 
73
  {$EXTERNALSYM DFS_VOLUME_STATE_OFFLINE}
 
74
  DFS_VOLUME_STATE_ONLINE       = 4;
 
75
  {$EXTERNALSYM DFS_VOLUME_STATE_ONLINE}
 
76
 
 
77
//
 
78
// These are valid for setting the volume state on the root
 
79
// These are available to force a resynchronize on the root
 
80
// volume or to put it in a standby mode.
 
81
//
 
82
 
 
83
  DFS_VOLUME_STATE_RESYNCHRONIZE = $10;
 
84
  {$EXTERNALSYM DFS_VOLUME_STATE_RESYNCHRONIZE}
 
85
  DFS_VOLUME_STATE_STANDBY       = $20;
 
86
  {$EXTERNALSYM DFS_VOLUME_STATE_STANDBY}
 
87
 
 
88
//
 
89
// These are valid on getting the volume state on the root
 
90
// These are available to determine the flavor of DFS
 
91
// A few bits are reserved to determine the flavor of the DFS root.
 
92
// To get the flavor, and the state with DFS_VOLUME_FLAVORS.
 
93
//
 
94
// (_state & DFS_VOLUME_FLAVORS) will tell you the flavor of the dfs root.
 
95
//
 
96
//
 
97
 
 
98
  DFS_VOLUME_FLAVORS = $0300;
 
99
  {$EXTERNALSYM DFS_VOLUME_FLAVORS}
 
100
 
 
101
  DFS_VOLUME_FLAVOR_UNUSED1    = $0000;
 
102
  {$EXTERNALSYM DFS_VOLUME_FLAVOR_UNUSED1}
 
103
  DFS_VOLUME_FLAVOR_STANDALONE = $0100;
 
104
  {$EXTERNALSYM DFS_VOLUME_FLAVOR_STANDALONE}
 
105
  DFS_VOLUME_FLAVOR_AD_BLOB    = $0200;
 
106
  {$EXTERNALSYM DFS_VOLUME_FLAVOR_AD_BLOB}
 
107
  DFS_STORAGE_FLAVOR_UNUSED2   = $0300;
 
108
  {$EXTERNALSYM DFS_STORAGE_FLAVOR_UNUSED2}
 
109
 
 
110
//
 
111
// DFS Storage State
 
112
//
 
113
 
 
114
  DFS_STORAGE_STATES        = $F;
 
115
  {$EXTERNALSYM DFS_STORAGE_STATES}
 
116
  DFS_STORAGE_STATE_OFFLINE = 1;
 
117
  {$EXTERNALSYM DFS_STORAGE_STATE_OFFLINE}
 
118
  DFS_STORAGE_STATE_ONLINE  = 2;
 
119
  {$EXTERNALSYM DFS_STORAGE_STATE_ONLINE}
 
120
  DFS_STORAGE_STATE_ACTIVE  = 4;
 
121
  {$EXTERNALSYM DFS_STORAGE_STATE_ACTIVE}
 
122
 
 
123
//
 
124
// Level 1:
 
125
//
 
126
 
 
127
type
 
128
  LPDFS_INFO_1 = ^DFS_INFO_1;
 
129
  {$EXTERNALSYM LPDFS_INFO_1}
 
130
  PDFS_INFO_1 = ^DFS_INFO_1;
 
131
  {$EXTERNALSYM PDFS_INFO_1}
 
132
  _DFS_INFO_1 = record
 
133
    EntryPath: LPWSTR; // Dfs name for the top of this piece of storage
 
134
  end;
 
135
  {$EXTERNALSYM _DFS_INFO_1}
 
136
  DFS_INFO_1 = _DFS_INFO_1;
 
137
  {$EXTERNALSYM DFS_INFO_1}
 
138
  TDfsInfo1 = DFS_INFO_1;
 
139
  PDfsInfo1 = PDFS_INFO_1;
 
140
 
 
141
//
 
142
// Level 2:
 
143
//
 
144
 
 
145
  LPDFS_INFO_2 = ^DFS_INFO_2;
 
146
  {$EXTERNALSYM LPDFS_INFO_2}
 
147
  PDFS_INFO_2 = ^DFS_INFO_2;
 
148
  {$EXTERNALSYM PDFS_INFO_2}
 
149
  _DFS_INFO_2 = record
 
150
    EntryPath: LPWSTR; // Dfs name for the top of this volume
 
151
    Comment: LPWSTR; // Comment for this volume
 
152
    State: DWORD; // State of this volume, one of DFS_VOLUME_STATE_*
 
153
    NumberOfStorages: DWORD; // Number of storages for this volume
 
154
  end;
 
155
  {$EXTERNALSYM _DFS_INFO_2}
 
156
  DFS_INFO_2 = _DFS_INFO_2;
 
157
  {$EXTERNALSYM DFS_INFO_2}
 
158
  TDfsInfo2 = DFS_INFO_2;
 
159
  PDfsInfo2 = PDFS_INFO_2;
 
160
 
 
161
  LPDFS_STORAGE_INFO = ^DFS_STORAGE_INFO;
 
162
  {$EXTERNALSYM LPDFS_STORAGE_INFO}
 
163
  PDFS_STORAGE_INFO = ^DFS_STORAGE_INFO;
 
164
  {$EXTERNALSYM PDFS_STORAGE_INFO}
 
165
  _DFS_STORAGE_INFO = record
 
166
    State: ULONG; // State of this storage, one of DFS_STORAGE_STATE_*
 
167
    // possibly OR'd with DFS_STORAGE_STATE_ACTIVE
 
168
    ServerName: LPWSTR; // Name of server hosting this storage
 
169
    ShareName: LPWSTR; // Name of share hosting this storage
 
170
  end;
 
171
  {$EXTERNALSYM _DFS_STORAGE_INFO}
 
172
  DFS_STORAGE_INFO = _DFS_STORAGE_INFO;
 
173
  {$EXTERNALSYM DFS_STORAGE_INFO}
 
174
  TDfsStorageInfo = DFS_STORAGE_INFO;
 
175
  PDfsStorageInfo = PDFS_STORAGE_INFO;
 
176
 
 
177
//
 
178
// Level 3:
 
179
//
 
180
 
 
181
  LPDFS_INFO_3 = ^DFS_INFO_3;
 
182
  {$EXTERNALSYM LPDFS_INFO_3}
 
183
  PDFS_INFO_3 = ^DFS_INFO_3;
 
184
  {$EXTERNALSYM PDFS_INFO_3}
 
185
  _DFS_INFO_3 = record
 
186
    EntryPath: LPWSTR; // Dfs name for the top of this volume
 
187
    Comment: LPWSTR; // Comment for this volume
 
188
    State: DWORD; // State of this volume, one of DFS_VOLUME_STATE_*
 
189
    NumberOfStorages: DWORD; // Number of storage servers for this volume
 
190
    Storage: LPDFS_STORAGE_INFO; // An array (of NumberOfStorages elements) of storage-specific information.
 
191
  end;
 
192
  {$EXTERNALSYM _DFS_INFO_3}
 
193
  DFS_INFO_3 = _DFS_INFO_3;
 
194
  {$EXTERNALSYM DFS_INFO_3}
 
195
  TDfsInfo3 = DFS_INFO_3;
 
196
  PDfsInfo3 = PDFS_INFO_3;
 
197
 
 
198
//
 
199
// Level 4:
 
200
//
 
201
 
 
202
  LPDFS_INFO_4 = ^DFS_INFO_4;
 
203
  {$EXTERNALSYM LPDFS_INFO_4}
 
204
  PDFS_INFO_4 = ^DFS_INFO_4;
 
205
  {$EXTERNALSYM PDFS_INFO_4}
 
206
  _DFS_INFO_4 = record
 
207
    EntryPath: LPWSTR; // Dfs name for the top of this volume
 
208
    Comment: LPWSTR; // Comment for this volume
 
209
    State: DWORD; // State of this volume, one of DFS_VOLUME_STATE_*
 
210
    Timeout: ULONG; // Timeout, in seconds, of this junction point
 
211
    Guid: GUID; // Guid of this junction point
 
212
    NumberOfStorages: DWORD; // Number of storage servers for this volume
 
213
    Storage: LPDFS_STORAGE_INFO; // An array (of NumberOfStorages elements) of storage-specific information.
 
214
  end;
 
215
  {$EXTERNALSYM _DFS_INFO_4}
 
216
  DFS_INFO_4 = _DFS_INFO_4;
 
217
  {$EXTERNALSYM DFS_INFO_4}
 
218
  TDfsInfo4 = DFS_INFO_4;
 
219
  PDfsInfo4 = PDFS_INFO_4;
 
220
 
 
221
//
 
222
// Level 100:
 
223
//
 
224
 
 
225
  LPDFS_INFO_100 = ^DFS_INFO_100;
 
226
  {$EXTERNALSYM LPDFS_INFO_100}
 
227
  PDFS_INFO_100 = ^DFS_INFO_100;
 
228
  {$EXTERNALSYM PDFS_INFO_100}
 
229
  _DFS_INFO_100 = record
 
230
    Comment: LPWSTR; // Comment for this volume or storage
 
231
  end;
 
232
  {$EXTERNALSYM _DFS_INFO_100}
 
233
  DFS_INFO_100 = _DFS_INFO_100;
 
234
  {$EXTERNALSYM DFS_INFO_100}
 
235
  TDfsInfo100 = DFS_INFO_100;
 
236
  PDfsInfo100 = PDFS_INFO_100;
 
237
 
 
238
//
 
239
// Level 101:
 
240
//
 
241
 
 
242
  LPDFS_INFO_101 = ^DFS_INFO_101;
 
243
  {$EXTERNALSYM LPDFS_INFO_101}
 
244
  PDFS_INFO_101 = ^DFS_INFO_101;
 
245
  {$EXTERNALSYM PDFS_INFO_101}
 
246
  _DFS_INFO_101 = record
 
247
    State: DWORD; // State of this storage, one of DFS_STORAGE_STATE_*
 
248
    // possibly OR'd with DFS_STORAGE_STATE_ACTIVE
 
249
  end;
 
250
  {$EXTERNALSYM _DFS_INFO_101}
 
251
  DFS_INFO_101 = _DFS_INFO_101;
 
252
  {$EXTERNALSYM DFS_INFO_101}
 
253
  TDfsInfo101 = DFS_INFO_101;
 
254
  PDfsInfo101 = PDFS_INFO_101;
 
255
 
 
256
//
 
257
// Level 102:
 
258
//
 
259
 
 
260
  LPDFS_INFO_102 = ^DFS_INFO_102;
 
261
  {$EXTERNALSYM LPDFS_INFO_102}
 
262
  PDFS_INFO_102 = ^DFS_INFO_102;
 
263
  {$EXTERNALSYM PDFS_INFO_102}
 
264
  _DFS_INFO_102 = record
 
265
    Timeout: ULONG; // Timeout, in seconds, of the junction
 
266
  end;
 
267
  {$EXTERNALSYM _DFS_INFO_102}
 
268
  DFS_INFO_102 = _DFS_INFO_102;
 
269
  {$EXTERNALSYM DFS_INFO_102}
 
270
  TDfsInfo102 = DFS_INFO_102;
 
271
  PDfsInfo102 = PDFS_INFO_102;
 
272
 
 
273
//
 
274
// Level 200:
 
275
//
 
276
 
 
277
  LPDFS_INFO_200 = ^DFS_INFO_200;
 
278
  {$EXTERNALSYM LPDFS_INFO_200}
 
279
  PDFS_INFO_200 = ^DFS_INFO_200;
 
280
  {$EXTERNALSYM PDFS_INFO_200}
 
281
  _DFS_INFO_200 = record
 
282
    FtDfsName: LPWSTR; // FtDfs name
 
283
  end;
 
284
  {$EXTERNALSYM _DFS_INFO_200}
 
285
  DFS_INFO_200 = _DFS_INFO_200;
 
286
  {$EXTERNALSYM DFS_INFO_200}
 
287
  TDfsInfo200 = DFS_INFO_200;
 
288
  PDfsInfo200 = PDFS_INFO_200;
 
289
 
 
290
//
 
291
// Level 300:
 
292
//
 
293
 
 
294
  LPDFS_INFO_300 = ^DFS_INFO_300;
 
295
  {$EXTERNALSYM LPDFS_INFO_300}
 
296
  PDFS_INFO_300 = ^DFS_INFO_300;
 
297
  {$EXTERNALSYM PDFS_INFO_300}
 
298
  _DFS_INFO_300 = record
 
299
    Flags: DWORD;
 
300
    DfsName: LPWSTR; // Dfs name
 
301
  end;
 
302
  {$EXTERNALSYM _DFS_INFO_300}
 
303
  DFS_INFO_300 = _DFS_INFO_300;
 
304
  {$EXTERNALSYM DFS_INFO_300}
 
305
  TDfsInfo300 = DFS_INFO_300;
 
306
  PDfsInfo300 = PDFS_INFO_300;
 
307
 
 
308
//
 
309
// Add a new volume or additional storage for an existing volume at
 
310
// DfsEntryPath.
 
311
//
 
312
 
 
313
function NetDfsAdd(DfsEntryPath, ServerName, ShareName, Comment: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
 
314
{$EXTERNALSYM NetDfsAdd}
 
315
 
 
316
//
 
317
// Flags:
 
318
//
 
319
 
 
320
const
 
321
  DFS_ADD_VOLUME     = 1; // Add a new volume to the DFS if not already there
 
322
  {$EXTERNALSYM DFS_ADD_VOLUME}
 
323
  DFS_RESTORE_VOLUME = 2; // Volume/Replica is being restored - do not verify share etc.
 
324
  {$EXTERNALSYM DFS_RESTORE_VOLUME}
 
325
 
 
326
//
 
327
// Setup/teardown API's for standard and FtDfs roots.
 
328
//
 
329
 
 
330
function NetDfsAddStdRoot(ServerName, RootShare, Comment: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
 
331
{$EXTERNALSYM NetDfsAddStdRoot}
 
332
 
 
333
function NetDfsRemoveStdRoot(ServerName, RootShare: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
 
334
{$EXTERNALSYM NetDfsRemoveStdRoot}
 
335
 
 
336
function NetDfsAddFtRoot(ServerName, RootShare, FtDfsName, Comment: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
 
337
{$EXTERNALSYM NetDfsAddFtRoot}
 
338
 
 
339
function NetDfsRemoveFtRoot(ServerName, RootShare, FtDfsName: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
 
340
{$EXTERNALSYM NetDfsRemoveFtRoot}
 
341
 
 
342
function NetDfsRemoveFtRootForced(DomainName, ServerName, RootShare, FtDfsName: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
 
343
{$EXTERNALSYM NetDfsRemoveFtRootForced}
 
344
 
 
345
//
 
346
// Call to reinitialize the dfsmanager on a machine
 
347
//
 
348
 
 
349
function NetDfsManagerInitialize(ServerName: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
 
350
{$EXTERNALSYM NetDfsManagerInitialize}
 
351
 
 
352
function NetDfsAddStdRootForced(ServerName, RootShare, Comment, Store: LPWSTR): NET_API_STATUS; stdcall;
 
353
{$EXTERNALSYM NetDfsAddStdRootForced}
 
354
 
 
355
function NetDfsGetDcAddress(ServerName: LPWSTR; var DcIpAddress: LPWSTR; var IsRoot: BOOLEAN; Timeout: PULONG): NET_API_STATUS; stdcall;
 
356
{$EXTERNALSYM NetDfsGetDcAddress}
 
357
 
 
358
//
 
359
// Flags for NetDfsSetDcAddress()
 
360
//
 
361
 
 
362
const
 
363
  NET_DFS_SETDC_FLAGS   = $00000000;
 
364
  {$EXTERNALSYM NET_DFS_SETDC_FLAGS}
 
365
  NET_DFS_SETDC_TIMEOUT = $00000001;
 
366
  {$EXTERNALSYM NET_DFS_SETDC_TIMEOUT}
 
367
  NET_DFS_SETDC_INITPKT = $00000002;
 
368
  {$EXTERNALSYM NET_DFS_SETDC_INITPKT}
 
369
 
 
370
//
 
371
// Structures used for site reporting
 
372
//
 
373
 
 
374
type
 
375
  LPDFS_SITENAME_INFO = ^DFS_SITENAME_INFO;
 
376
  {$EXTERNALSYM LPDFS_SITENAME_INFO}
 
377
  PDFS_SITENAME_INFO = ^DFS_SITENAME_INFO;
 
378
  {$EXTERNALSYM PDFS_SITENAME_INFO}
 
379
  DFS_SITENAME_INFO = record
 
380
    SiteFlags: ULONG; // Below
 
381
    SiteName: LPWSTR;
 
382
  end;
 
383
  {$EXTERNALSYM DFS_SITENAME_INFO}
 
384
  TDfsSiteNameInfo = DFS_SITENAME_INFO;
 
385
  PDfsSiteNameInfo = PDFS_SITENAME_INFO;
 
386
 
 
387
// SiteFlags
 
388
 
 
389
const
 
390
  DFS_SITE_PRIMARY = $1; // This site returned by DsGetSiteName()
 
391
  {$EXTERNALSYM DFS_SITE_PRIMARY}
 
392
 
 
393
type
 
394
  LPDFS_SITELIST_INFO = ^DFS_SITELIST_INFO;
 
395
  {$EXTERNALSYM LPDFS_SITELIST_INFO}
 
396
  PDFS_SITELIST_INFO = ^DFS_SITELIST_INFO;
 
397
  {$EXTERNALSYM PDFS_SITELIST_INFO}
 
398
  DFS_SITELIST_INFO = record
 
399
    cSites: ULONG;
 
400
    Site: array [0..0] of DFS_SITENAME_INFO;
 
401
  end;
 
402
  {$EXTERNALSYM DFS_SITELIST_INFO}
 
403
  TDfsSiteListInfo = DFS_SITELIST_INFO;
 
404
  PDfsSiteListInfo = PDFS_SITELIST_INFO;
 
405
 
 
406
//
 
407
// Remove a volume or additional storage for volume from the Dfs at
 
408
// DfsEntryPath. When applied to the last storage in a volume, removes
 
409
// the volume from the DFS.
 
410
//
 
411
 
 
412
function NetDfsRemove(DfsEntryPath, ServerName, ShareName: LPWSTR): NET_API_STATUS; stdcall;
 
413
{$EXTERNALSYM NetDfsRemove}
 
414
 
 
415
//
 
416
// Get information about all of the volumes in the Dfs. DfsName is
 
417
// the "server" part of the UNC name used to refer to this particular Dfs.
 
418
//
 
419
// Valid levels are 1-4, 200
 
420
//
 
421
 
 
422
function NetDfsEnum(DfsName: LPWSTR; Level, PrefMaxLen: DWORD; var Buffer: LPBYTE; EntriesRead, ResumeHandle: LPDWORD): NET_API_STATUS; stdcall;
 
423
{$EXTERNALSYM NetDfsEnum}
 
424
 
 
425
//
 
426
// Get information about the volume or storage.
 
427
// If ServerName and ShareName are specified, the information returned
 
428
// is specific to that server and share, else the information is specific
 
429
// to the volume as a whole.
 
430
//
 
431
// Valid levels are 1-4, 100
 
432
//
 
433
 
 
434
function NetDfsGetInfo(DfsEntryPath, ServerName, ShareName: LPWSTR; Level: DWORD; var Buffer: LPBYTE): NET_API_STATUS; stdcall;
 
435
{$EXTERNALSYM NetDfsGetInfo}
 
436
 
 
437
//
 
438
// Set info about the volume or storage.
 
439
// If ServerName and ShareName are specified, the information set is
 
440
// specific to that server and share, else the information is specific
 
441
// to the volume as a whole.
 
442
//
 
443
// Valid levels are 100, 101 and 102
 
444
//
 
445
 
 
446
function NetDfsSetInfo(DfsEntryPath, ServerName, ShareName: LPWSTR; Level: DWORD; Buffer: LPBYTE): NET_API_STATUS; stdcall;
 
447
{$EXTERNALSYM NetDfsSetInfo}
 
448
 
 
449
//
 
450
// Get client's cached information about the volume or storage.
 
451
// If ServerName and ShareName are specified, the information returned
 
452
// is specific to that server and share, else the information is specific
 
453
// to the volume as a whole.
 
454
//
 
455
// Valid levels are 1-4
 
456
//
 
457
 
 
458
function NetDfsGetClientInfo(DfsEntryPath, ServerName, ShareName: LPWSTR; Level: DWORD; var Buffer: LPBYTE): NET_API_STATUS; stdcall;
 
459
{$EXTERNALSYM NetDfsGetClientInfo}
 
460
 
 
461
//
 
462
// Set client's cached info about the volume or storage.
 
463
// If ServerName and ShareName are specified, the information set is
 
464
// specific to that server and share, else the information is specific
 
465
// to the volume as a whole.
 
466
//
 
467
// Valid levels are 101 and 102.
 
468
//
 
469
 
 
470
function NetDfsSetClientInfo(DfsEntryPath, ServerName, ShareName: LPWSTR; Level: DWORD; Buffer: LPBYTE): NET_API_STATUS; stdcall;
 
471
{$EXTERNALSYM NetDfsSetClientInfo}
 
472
 
 
473
//
 
474
// Move a DFS volume and all subordinate volumes from one place in the
 
475
// DFS to another place in the DFS.
 
476
//
 
477
 
 
478
function NetDfsMove(DfsEntryPath: LPWSTR; DfsNewEntryPath: LPWSTR): NET_API_STATUS; stdcall;
 
479
{$EXTERNALSYM NetDfsMove}
 
480
 
 
481
function NetDfsRename(Path: LPWSTR; NewPath: LPWSTR): NET_API_STATUS; stdcall;
 
482
{$EXTERNALSYM NetDfsRename}
 
483
 
 
484
implementation
 
485
 
 
486
{$IFDEF DYNAMIC_LINK}
 
487
 
 
488
var
 
489
  _NetDfsAdd: Pointer;
 
490
 
 
491
function NetDfsAdd;
 
492
begin
 
493
  GetProcedureAddress(_NetDfsAdd, netapi32, 'NetDfsAdd');
 
494
  asm
 
495
        MOV     ESP, EBP
 
496
        POP     EBP
 
497
        JMP     [_NetDfsAdd]
 
498
  end;
 
499
end;
 
500
 
 
501
var
 
502
  _NetDfsAddStdRoot: Pointer;
 
503
 
 
504
function NetDfsAddStdRoot;
 
505
begin
 
506
  GetProcedureAddress(_NetDfsAddStdRoot, netapi32, 'NetDfsAddStdRoot');
 
507
  asm
 
508
        MOV     ESP, EBP
 
509
        POP     EBP
 
510
        JMP     [_NetDfsAddStdRoot]
 
511
  end;
 
512
end;
 
513
 
 
514
var
 
515
  _NetDfsRemoveStdRoot: Pointer;
 
516
 
 
517
function NetDfsRemoveStdRoot;
 
518
begin
 
519
  GetProcedureAddress(_NetDfsRemoveStdRoot, netapi32, 'NetDfsRemoveStdRoot');
 
520
  asm
 
521
        MOV     ESP, EBP
 
522
        POP     EBP
 
523
        JMP     [_NetDfsRemoveStdRoot]
 
524
  end;
 
525
end;
 
526
 
 
527
var
 
528
  _NetDfsAddFtRoot: Pointer;
 
529
 
 
530
function NetDfsAddFtRoot;
 
531
begin
 
532
  GetProcedureAddress(_NetDfsAddFtRoot, netapi32, 'NetDfsAddFtRoot');
 
533
  asm
 
534
        MOV     ESP, EBP
 
535
        POP     EBP
 
536
        JMP     [_NetDfsAddFtRoot]
 
537
  end;
 
538
end;
 
539
 
 
540
var
 
541
  _NetDfsRemoveFtRoot: Pointer;
 
542
 
 
543
function NetDfsRemoveFtRoot;
 
544
begin
 
545
  GetProcedureAddress(_NetDfsRemoveFtRoot, netapi32, 'NetDfsRemoveFtRoot');
 
546
  asm
 
547
        MOV     ESP, EBP
 
548
        POP     EBP
 
549
        JMP     [_NetDfsRemoveFtRoot]
 
550
  end;
 
551
end;
 
552
 
 
553
var
 
554
  _NetDfsRemoveFtRootForced: Pointer;
 
555
 
 
556
function NetDfsRemoveFtRootForced;
 
557
begin
 
558
  GetProcedureAddress(_NetDfsRemoveFtRootForced, netapi32, 'NetDfsRemoveFtRootForced');
 
559
  asm
 
560
        MOV     ESP, EBP
 
561
        POP     EBP
 
562
        JMP     [_NetDfsRemoveFtRootForced]
 
563
  end;
 
564
end;
 
565
 
 
566
var
 
567
  _NetDfsManagerInitialize: Pointer;
 
568
 
 
569
function NetDfsManagerInitialize;
 
570
begin
 
571
  GetProcedureAddress(_NetDfsManagerInitialize, netapi32, 'NetDfsManagerInitialize');
 
572
  asm
 
573
        MOV     ESP, EBP
 
574
        POP     EBP
 
575
        JMP     [_NetDfsManagerInitialize]
 
576
  end;
 
577
end;
 
578
 
 
579
var
 
580
  _NetDfsAddStdRootForced: Pointer;
 
581
 
 
582
function NetDfsAddStdRootForced;
 
583
begin
 
584
  GetProcedureAddress(_NetDfsAddStdRootForced, netapi32, 'NetDfsAddStdRootForced');
 
585
  asm
 
586
        MOV     ESP, EBP
 
587
        POP     EBP
 
588
        JMP     [_NetDfsAddStdRootForced]
 
589
  end;
 
590
end;
 
591
 
 
592
var
 
593
  _NetDfsGetDcAddress: Pointer;
 
594
 
 
595
function NetDfsGetDcAddress;
 
596
begin
 
597
  GetProcedureAddress(_NetDfsGetDcAddress, netapi32, 'NetDfsGetDcAddress');
 
598
  asm
 
599
        MOV     ESP, EBP
 
600
        POP     EBP
 
601
        JMP     [_NetDfsGetDcAddress]
 
602
  end;
 
603
end;
 
604
 
 
605
var
 
606
  _NetDfsRemove: Pointer;
 
607
 
 
608
function NetDfsRemove;
 
609
begin
 
610
  GetProcedureAddress(_NetDfsRemove, netapi32, 'NetDfsRemove');
 
611
  asm
 
612
        MOV     ESP, EBP
 
613
        POP     EBP
 
614
        JMP     [_NetDfsRemove]
 
615
  end;
 
616
end;
 
617
 
 
618
var
 
619
  _NetDfsEnum: Pointer;
 
620
 
 
621
function NetDfsEnum;
 
622
begin
 
623
  GetProcedureAddress(_NetDfsEnum, netapi32, 'NetDfsEnum');
 
624
  asm
 
625
        MOV     ESP, EBP
 
626
        POP     EBP
 
627
        JMP     [_NetDfsEnum]
 
628
  end;
 
629
end;
 
630
 
 
631
var
 
632
  _NetDfsGetInfo: Pointer;
 
633
 
 
634
function NetDfsGetInfo;
 
635
begin
 
636
  GetProcedureAddress(_NetDfsGetInfo, netapi32, 'NetDfsGetInfo');
 
637
  asm
 
638
        MOV     ESP, EBP
 
639
        POP     EBP
 
640
        JMP     [_NetDfsGetInfo]
 
641
  end;
 
642
end;
 
643
 
 
644
var
 
645
  _NetDfsSetInfo: Pointer;
 
646
 
 
647
function NetDfsSetInfo;
 
648
begin
 
649
  GetProcedureAddress(_NetDfsSetInfo, netapi32, 'NetDfsSetInfo');
 
650
  asm
 
651
        MOV     ESP, EBP
 
652
        POP     EBP
 
653
        JMP     [_NetDfsSetInfo]
 
654
  end;
 
655
end;
 
656
 
 
657
var
 
658
  _NetDfsGetClientInfo: Pointer;
 
659
 
 
660
function NetDfsGetClientInfo;
 
661
begin
 
662
  GetProcedureAddress(_NetDfsGetClientInfo, netapi32, 'NetDfsGetClientInfo');
 
663
  asm
 
664
        MOV     ESP, EBP
 
665
        POP     EBP
 
666
        JMP     [_NetDfsGetClientInfo]
 
667
  end;
 
668
end;
 
669
 
 
670
var
 
671
  _NetDfsSetClientInfo: Pointer;
 
672
 
 
673
function NetDfsSetClientInfo;
 
674
begin
 
675
  GetProcedureAddress(_NetDfsSetClientInfo, netapi32, 'NetDfsSetClientInfo');
 
676
  asm
 
677
        MOV     ESP, EBP
 
678
        POP     EBP
 
679
        JMP     [_NetDfsSetClientInfo]
 
680
  end;
 
681
end;
 
682
 
 
683
var
 
684
  _NetDfsMove: Pointer;
 
685
 
 
686
function NetDfsMove;
 
687
begin
 
688
  GetProcedureAddress(_NetDfsMove, netapi32, 'NetDfsMove');
 
689
  asm
 
690
        MOV     ESP, EBP
 
691
        POP     EBP
 
692
        JMP     [_NetDfsMove]
 
693
  end;
 
694
end;
 
695
 
 
696
var
 
697
  _NetDfsRename: Pointer;
 
698
 
 
699
function NetDfsRename;
 
700
begin
 
701
  GetProcedureAddress(_NetDfsRename, netapi32, 'NetDfsRename');
 
702
  asm
 
703
        MOV     ESP, EBP
 
704
        POP     EBP
 
705
        JMP     [_NetDfsRename]
 
706
  end;
 
707
end;
 
708
 
 
709
{$ELSE}
 
710
 
 
711
function NetDfsAdd; external netapi32 name 'NetDfsAdd';
 
712
function NetDfsAddStdRoot; external netapi32 name 'NetDfsAddStdRoot';
 
713
function NetDfsRemoveStdRoot; external netapi32 name 'NetDfsRemoveStdRoot';
 
714
function NetDfsAddFtRoot; external netapi32 name 'NetDfsAddFtRoot';
 
715
function NetDfsRemoveFtRoot; external netapi32 name 'NetDfsRemoveFtRoot';
 
716
function NetDfsRemoveFtRootForced; external netapi32 name 'NetDfsRemoveFtRootForced';
 
717
function NetDfsManagerInitialize; external netapi32 name 'NetDfsManagerInitialize';
 
718
function NetDfsAddStdRootForced; external netapi32 name 'NetDfsAddStdRootForced';
 
719
function NetDfsGetDcAddress; external netapi32 name 'NetDfsGetDcAddress';
 
720
function NetDfsRemove; external netapi32 name 'NetDfsRemove';
 
721
function NetDfsEnum; external netapi32 name 'NetDfsEnum';
 
722
function NetDfsGetInfo; external netapi32 name 'NetDfsGetInfo';
 
723
function NetDfsSetInfo; external netapi32 name 'NetDfsSetInfo';
 
724
function NetDfsGetClientInfo; external netapi32 name 'NetDfsGetClientInfo';
 
725
function NetDfsSetClientInfo; external netapi32 name 'NetDfsSetClientInfo';
 
726
function NetDfsMove; external netapi32 name 'NetDfsMove';
 
727
function NetDfsRename; external netapi32 name 'NetDfsRename';
 
728
 
 
729
{$ENDIF DYNAMIC_LINK}
 
730
 
 
731
end.