Hi forum,
I’m new to Rust and really like the approach behind it. I have never been so experienced in C/c++ that I could be sure that my programs will not just crash due to some memory problems and it seems that Rust solves a lot of my problems.
I’m just trying to implement my first little project under Windows and came to a general problem. I need to call
https://msdn.microsoft.com/en-us/library/windows/desktop/aa379159(v=vs.85).aspx in order to obtain the SID of a user. I just used cargo and became familiar with the concept of crates so that I should in principle be able to call into a Windows API. However, I’m lost with the translation of all the data types that the function expects.
BOOL WINAPI LookupAccountName(
In_opt LPCTSTR lpSystemName,
In LPCTSTR lpAccountName,
Out_opt PSID Sid,
Inout LPDWORD cbSid,
Out_opt LPTSTR ReferencedDomainName,
Inout LPDWORD cchReferencedDomainName,
Out PSID_NAME_USE peUse
);
I searched this forum and found Tidy pattern to work with LPSTR (mutable char array) but that does only seem to solve a small part of my problem. Is there anybody here able (and willing) to help me out with a working example as a starting point? Any help would be greatly appreciated.
Thanks
Norbert