Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
2 Views

getting SID using LookupAccountName - 2019

Hello:

An earlier post, Retrieving SID using LookupAccountName ( started 01/20/2013 - 6:22), dealt with the issue of getting a SID using advapi32's LookupAccountName. A solution was posted and is attached.

That solution, as a console app, does not work now in a Win10 x64 environment.

I have Visual Studio Professional 2019 v 16.1.3 using Net Framework 4.7.03062

  • Visual C++ 2019
  • Microsoft Visual C++ 2019
  • Intel® Parallel Studio XE 2019 Update 4 Composer Edition for C++ Windows*   Package ID: w_comp_lib_2019.4.245
  • Intel® Parallel Studio XE 2019 Update 4 Composer Edition for C++ Windows* Integration for Microsoft* Visual Studio* 2019, Version 19.0.6.16,
  • Intel® Parallel Studio XE 2019 Update 4 Composer Edition for Fortran Windows*   Package ID: w_comp_lib_2019.4.245
  • Intel® Parallel Studio XE 2019 Update 4 Composer Edition for Fortran Windows* Integration for Microsoft Visual Studio* 2019, Version 19.0.0052.16
  • Microsoft Visual C++ Wizards   1.0
  • Microsoft Visual C++ Wizards

Configuration Manager is release and x64.

I've used default settings for the project. I've tried many sid.f90 variations  using LOC and pointers, but none seem to work as well as inserting TYPE *, or PRINT * statements randomly.

Any help is appreciated.

Thanks,

Cliff P.

 

0 Kudos
5 Replies
Highlighted
Black Belt
2 Views

The declarations of

The declarations of LookupAccountName and LookupAccountSid in advapi32.f90 are wrong. I'll report this to Intel. The attached sid.f90 works.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
2 Views

Thank you Steve.

Thank you Steve.

Your sid.f90 worked as written.

0 Kudos
Highlighted
Black Belt
2 Views

Just a comment that if/when

Just a comment that if/when Intel updates module ADVAPI32, you'll need to remove the additional interfaces and the ONLY from the USE - you'll know because you'll get compile-time errors. You should not have to change the application code. I will also ask them to add ConvertStringSidToSid and will look to see what else seems reasonable to add. I am sure there are hundreds of new definitions - before I left Intel I spent months mainly adding to KERNEL32, but a few snuck into other modules. I didn't get into this set of APIs and it is grueling, manual work, so I'm not going to go crazy here.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Black Belt
2 Views

I submitted ticket 04249991

I submitted ticket 04249991 with my updates to ADVAPI32.

Attached is a module ADVAPI32_NEW which can be used instead of ADVAPI32 for now. I also added the functions from sddi.h that were used in Cliff's example. I also attach a revised version of sid.f90 that uses the updated definitions.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Black Belt
2 Views

Almost there. The 19.1

Almost there. The 19.1 compiler fixes the incorrect declarations in ADVAPI32. Unfortunately they did not also add the sddi.h declarations I asked for (and supplied!), so ConvertSidToStringSid is not found.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos