Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
#DefineFunction GetDFStarget ( DFSLink ) DfsLinkWide=BinaryAlloc(1000) BinaryPokeStr(DfsLinkWide,0,DfsLink) BinaryConvert(DfsLinkWide,0,3,0,0) ; convert to unicode KernelFQFN = StrCat ( DirWindows ( 1 ) , 'NETAPI32.DLL' ) ; allocate memory for the pointer to the structure that will be returned from the dllcall function. p0 = BinaryAlloc (4) ; Pointer to structure. BinaryPoke4(p0,0,1) ; Populate the pointer BinaryEodSet(p0,4) ; set end of data to 4 bytes operation="3" ; parameter that says we want DFS target information. operation=Int(operation) ; convert the type to Integer ;message("DFSLink", KernelFQFN) ; dllcall ( ; dll name where the function resides, ; entry point (function), ; not used, ; not used, ; parameter listed above, ; pointer to the location in memory where the data will be ; ) handle="" handle = DllLoad(KernelFQFN) rtn = DllCall (handle, long:"NetDfsGetInfo", lpbinary:DfsLinkWide, lpnull, lpnull, long:operation, lpbinary:p0) ;extract data here DllFree(handle) BinaryFree(KernelFQFN) BinaryFree(DfsLinkWide) BinaryFree(p0)
Article ID: W16951
File Created: 2009:06:10:08:15:24
Last Updated: 2009:06:10:08:15:24