I'm trying to run the below script, but it's failing. The end goal here is to tap into the Win32 API to see the shell values for System.Volume.BitLockerProtection as i need to be able to check on BitLocker status without elevation.
It's present in the Windows interface to any user, so i'm sure there must be a way that doesn't require admin rights.
I tried the following, but it's telling me '
[Error] redeclaration of 'Unknown'
I'd appreciate any pointers to help me on my way, unless anyone has any better ideas?
Thanks for the hint, what IDE are you using? I've made the change, switched my profile to c++ 11 and still get an error, showing that
1 2 3 4
In function `getDriveEncryptionStatus(wchar_tconst*)':
undefined reference to `__imp_SHCreateItemFromParsingName'
undefined reference to `__imp_PSGetPropertyKeyFromName'
[Error] ld returned 1 exit status
It seems odd that all is OK on your side. I tried adding -lkernel32 -lole32 to my compiler options, however that also seemed to fail.
I am using VS 2017 CE.
By default it adds kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;
shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib
You asked what IDE/compiler Thomas was using, but you didn't say which compiler you were using. Since this is Windows code, I assume you're using some variant of MinGW, but can you say specifically what build/version?
Your library #pragma comments might only be supported in Visual Studio, not MinGW, although I'm not completely sure.