Provide LSA access for applications.
#include <uLib/UmLsa.h>
Some of LSA is available through NtSecApi.h, and can be readily used in usermode.
However, the parts available through NtLsa.h have the usual DDK quirks when trying
to use them in user mode. This module provides function pointers and declarations
to cover some useful NtLsa parts. Note: LSA is only partially documented by MSDN.
This module also provide supplementary APIs that make your task easier
when you have to work with the LSA.
|
#define | NT_SUCCESS(rc) ((rc) >= STATUS_SUCCESS) |
|
#define | NT_ERROR(Status) (((ULONG)(Status) >> 30) == 3) |
|
◆ NT_SUCCESS
#define NT_SUCCESS |
( |
|
rc | ) |
((rc) >= STATUS_SUCCESS) |
◆ NT_ERROR
#define NT_ERROR |
( |
|
Status | ) |
(((ULONG)(Status) >> 30) == 3) |
◆ InitLsaFunc()
- Note
- InitLsaFunc must be called before you can use any UmLsa functions.
It initializes the LSA function pointers, e.g. _LsaEnumerateAccounts().
Definition at line 19 of file UmLsa.cpp.
◆ OpenLsaPolicy()
bool OpenLsaPolicy |
( |
CSTR |
Machine, |
|
|
ACCESS_MASK |
Access, |
|
|
PLSA_HANDLE |
phPolicy |
|
) |
| |
Transmutable version of LsaOpenPolicy.
Easy to use, since you don't need to fiddle with UNICODE_STRING and possible wide translation.
- Parameters
-
[in] | Machine | Target system. Use NULL for the local machine, otherwise "the_computer" or "\\the_computer". |
[in] | Access | Requested access rights, f.ex. POLICY_ALL_ACCESS. |
[out] | phPolicy | Receives a handle to the policy object. |
Definition at line 132 of file UmLsa.cpp.
◆ LsaCloseEx()
LSA_HANDLE LsaCloseEx |
( |
LSA_HANDLE |
hLsa | ) |
|
LsaCloseEx returns NULL on success, else hLsa and GetLastError.
Typical use:
Definition at line 155 of file UmLsa.cpp.