narkive is for sale. Interested? (dismiss)
Discussion:
LsaOpenAccount / LsaCreateAccount
(too old to reply)
Uwe Posselt
2005-02-14 14:07:02 UTC
Permalink
Hi,

I've found the article "HOWTO: Manage User Privileges Programmatically in
Windows NT" in the MSDN.

The sample code uses the functions "LsaOpenAccount" and "LsaCreateAccount".
I cannot find any information about this functions. There is no header and no
DLL containing the functions. Only the ADVAPI32.LIB contains the functions.

Where I can find more information about the functions?

Any help is greatly appreciated!

Uwe Posselt
Sam Hobbs
2005-02-14 18:24:34 UTC
Permalink
The KB article says that the headers and help information are in the
Platform SDK but I can't find them. I searched the online MSDN and the KB
article is the only result.

The next step is to search this newsgroup, but I did not find anything there
that helps. So I searched all newsgroups available in Google Groups and
there are a couple of messages there that refer to samples in the MVPS.org
site.

You could also search the World Wide Web (I assume you know where that is)
for any other samples and such.
Post by Uwe Posselt
Hi,
I've found the article "HOWTO: Manage User Privileges Programmatically in
Windows NT" in the MSDN.
The sample code uses the functions "LsaOpenAccount" and
"LsaCreateAccount".
I cannot find any information about this functions. There is no header and no
DLL containing the functions. Only the ADVAPI32.LIB contains the functions.
Where I can find more information about the functions?
Any help is greatly appreciated!
Uwe Posselt
Sam Hobbs
2005-02-14 18:44:57 UTC
Permalink
Correction.

I searched the online MSDN again and got 25 results. Searching the internet
using Google got many hits.

The string "LsaOpenPolicy" does not appear anywhere in any file in the
version of the Platform SDK I have, which is the February 2003 version.
Post by Uwe Posselt
Hi,
I've found the article "HOWTO: Manage User Privileges Programmatically in
Windows NT" in the MSDN.
The sample code uses the functions "LsaOpenAccount" and
"LsaCreateAccount".
I cannot find any information about this functions. There is no header and no
DLL containing the functions. Only the ADVAPI32.LIB contains the functions.
Where I can find more information about the functions?
Any help is greatly appreciated!
Uwe Posselt
Sam Hobbs
2005-02-14 19:10:09 UTC
Permalink
Correction of the Correction.

LsaOpenAccount is in the MSDN in just the one KB article; I somehow searched
the MSDN for LsaOpenPolicy.

I apologize for the confusion. I hope someone that knows more will help. I
hope my suggestions for where to search will help at least.
Post by Sam Hobbs
Correction.
I searched the online MSDN again and got 25 results. Searching the
internet using Google got many hits.
l***@gmail.com
2018-07-21 07:25:28 UTC
Permalink
Post by Uwe Posselt
Where I can find more information about the functions?
Though the OP was a long time ago, there was never a real
answer posted, so here's a little clarity for anyone else
who stumbles on the same problem.

LsaOpenAccount and LsaCreateAccount are declared in
NtLsa.h, which is part of the DDK, not the Platform SDK.
As such, they are not easily available in user mode.

However, you may replicate the necessary data structures
and function signatures to your user mode project, and link
dynamically to the functions using GetProcAddress.

Doing so, you'll be able to massage the sample code
into a function user mode test.

HTH
l***@gmail.com
2018-07-21 07:30:29 UTC
Permalink
FYI, these are my own function pointers for them:

extern NTSTATUS (NTAPI *_LsaOpenAccount)(
__in LSA_HANDLE PolicyHandle,
__in PSID AccountSid,
__in ACCESS_MASK DesiredAccess,
__out PLSA_HANDLE AccountHandle
);

extern NTSTATUS (NTAPI *_LsaCreateAccount)(
__in LSA_HANDLE PolicyHandle,
__in PSID AccountSid,
__in ACCESS_MASK DesiredAccess,
__out PLSA_HANDLE AccountHandle
);

Loading...