* mkgroup.c: Add function pointers for functions from advapi32.dll.
(load_netapi): Load used functions from advapi32.dll. (main): Use function pointers instead of statically linked functions from advapi32.dll.
This commit is contained in:
parent
b7e51146bf
commit
d183515c9f
@ -1,3 +1,10 @@
|
|||||||
|
2002-07-01 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* mkgroup.c: Add function pointers for functions from advapi32.dll.
|
||||||
|
(load_netapi): Load used functions from advapi32.dll.
|
||||||
|
(main): Use function pointers instead of statically linked functions
|
||||||
|
from advapi32.dll.
|
||||||
|
|
||||||
2002-07-01 Christopher Faylor <cgf@redhat.com>
|
2002-07-01 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* mount.cc (main): Ensure that mount_already_exists() also gets default
|
* mount.cc (main): Ensure that mount_already_exists() also gets default
|
||||||
|
@ -32,6 +32,11 @@ NET_API_STATUS WINAPI (*netlocalgroupgetmembers)(LPWSTR,LPWSTR,DWORD,PBYTE*,DWOR
|
|||||||
NET_API_STATUS WINAPI (*netgetdcname)(LPWSTR,LPWSTR,PBYTE*);
|
NET_API_STATUS WINAPI (*netgetdcname)(LPWSTR,LPWSTR,PBYTE*);
|
||||||
NET_API_STATUS WINAPI (*netgroupgetusers)(LPWSTR,LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
|
NET_API_STATUS WINAPI (*netgroupgetusers)(LPWSTR,LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
|
||||||
|
|
||||||
|
NTSTATUS NTAPI (*lsaclose)(LSA_HANDLE);
|
||||||
|
NTSTATUS NTAPI (*lsaopenpolicy)(PLSA_UNICODE_STRING,PLSA_OBJECT_ATTRIBUTES,ACCESS_MASK,PLSA_HANDLE);
|
||||||
|
NTSTATUS NTAPI (*lsaqueryinformationpolicy)(LSA_HANDLE,POLICY_INFORMATION_CLASS,PVOID*);
|
||||||
|
NTSTATUS NTAPI (*lsafreememory)(PVOID);
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
#define min(a,b) (((a)<(b))?(a):(b))
|
#define min(a,b) (((a)<(b))?(a):(b))
|
||||||
#endif
|
#endif
|
||||||
@ -57,6 +62,18 @@ load_netapi ()
|
|||||||
if (!(netgetdcname = (void *) GetProcAddress (h, "NetGetDCName")))
|
if (!(netgetdcname = (void *) GetProcAddress (h, "NetGetDCName")))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (!(h = LoadLibrary ("advapi32.dll")))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!(lsaclose = (void *) GetProcAddress (h, "LsaClose")))
|
||||||
|
return FALSE;
|
||||||
|
if (!(lsaopenpolicy = (void *) GetProcAddress (h, "LsaOpenPolicy")))
|
||||||
|
return FALSE;
|
||||||
|
if (!(lsaqueryinformationpolicy = (void *) GetProcAddress (h, "LsaQueryInformationPolicy")))
|
||||||
|
return FALSE;
|
||||||
|
if (!(lsafreememory = (void *) GetProcAddress (h, "LsaFreeMemory")))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,10 +590,10 @@ main (int argc, char **argv)
|
|||||||
psid = (PSID) buf;
|
psid = (PSID) buf;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = LsaOpenPolicy(NULL, &oa, POLICY_VIEW_LOCAL_INFORMATION, &lsa);
|
ret = lsaopenpolicy (NULL, &oa, POLICY_VIEW_LOCAL_INFORMATION, &lsa);
|
||||||
if (ret == STATUS_SUCCESS && lsa != INVALID_HANDLE_VALUE)
|
if (ret == STATUS_SUCCESS && lsa != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
ret = LsaQueryInformationPolicy (lsa,
|
ret = lsaqueryinformationpolicy (lsa,
|
||||||
PolicyPrimaryDomainInformation,
|
PolicyPrimaryDomainInformation,
|
||||||
(PVOID *) &pdi);
|
(PVOID *) &pdi);
|
||||||
if (ret == STATUS_SUCCESS)
|
if (ret == STATUS_SUCCESS)
|
||||||
@ -586,9 +603,9 @@ main (int argc, char **argv)
|
|||||||
CopySid (1024, (PSID) buf, pdi->Sid);
|
CopySid (1024, (PSID) buf, pdi->Sid);
|
||||||
psid = (PSID) buf;
|
psid = (PSID) buf;
|
||||||
}
|
}
|
||||||
LsaFreeMemory (pdi);
|
lsafreememory (pdi);
|
||||||
}
|
}
|
||||||
LsaClose (lsa);
|
lsaclose (lsa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!psid)
|
if (!psid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user