I'm using visual C++ 2009 under wine. I have all paths set correctly for command line operation (cl.exe, link.exe, etc.) and can compile normal programs just fine. However, when I supply the -Zi or -ZI flags to include debugging information, the program exits with an error:
: fatal error C1902: Program database manager mismatch; please check your installation
I have all the strictly necessary dll's and exe's in the path: mspdb80.dll, mspdbcore.dll, mspdbsrv.exe
And I even made sure to try the program with the native window dll's rather than just wine's build in version, eg: msvcr90.dll and msobj90.dll and msvcp90.dll but it makes no difference.
But: oddly enough -- I can successfully start the server manually without the error:
C:mspdbsrv.exe -start -spawn -shutdowntime -1
So ... it's not the server program itself which has a mismatch, but some kind of error when cl.exe tries to communicate with the server ; eg: because running cl.exe has exactly the same failure even when mspdbsrv.exe is already running. (Mixed versions are ruled out, anyhow -- this is a clean install).
The only possible cause I have located so far on the web for this error is this one: quoted
It tries to impersonate, but it looks to me as if it does not make the necessary call to LsaLogonUser. As a result, the wrong SID is in the token as the primary user. According to filemon, the debug server calls into secur32, which suggests that it is doing interpretive access control. It finds the service's SID instead of the users SID in some slot in the token that it gets via RPC, and then everything goes downhill from there.
Why VS feels the need to put the PDB access in a separate process under separate access rights is very puzzling, but there it is. ...
So -- I think what I am probably looking for are some command line tools / source code to answer the following questions -- but I have no idea where to get them.
1) How can I check what kind of authentication/logon session the server is running, and what cl.exe actaully needs. I have processexplorer, and it says that mspdbsrv.exe when running manually has the following security -- but I don't know if this is enough information (I'm new to windows security.)
User: darkstar\andrew3
SID:S-1-5-21-0-0-0-1000
Session:0
Logon Session: 0
...Group... ...Flags...
BUILTIN\Administrators Owner
BUILTIN\Users Mandatory
Everyone Mandatory
LOCAL Mandatory
Logon SID (S-1-5-5-0-1) Mandatory
NT AUTHORITY\Authenticated Users Mandatory
NT AUTHORITY\INTERACTIVE Mandatory
Group SID is: S-1-5-4
....privelege.... ...flags....
SeChangeNotifyPrivilege Default Enabled
SeSecurityPrivilege Disabled
SeBackupPrivilege Disabled
SeRestorePrivilege Disabled
SeSystemtimePrivilege Disabled
SeShutdownPrivilege Disabled
SeRemoteShutdownPrivilege Disabled
SeTakeOwnershipPrivilege Disabled
SeDebugPrivilege Disabled
SeSystemEnvironmentPrivilege Disabled
SeSystemProfilePrivilege Disabled
SeProfileSingleProcessPrivilege Disabled
SeIncreaseBasePriorityPrivilege Disabled
SeLoadDriverPrivilege Default Enabled
SeCreatePagefilePrivilege Disabled
SeIncreaseQuotaPrivilege Disabled
SeUndockPrivilege Disabled
SeManageVolumePrivilege Disabled
SeImpersonatePrivilege Default Enabled
SeCreateGlobalPrivilege Default Enabled
But I have no idea which permissions are important to tell if server is logged in, or merely in some kind of impersonation mode. Which values are important?
2) How can I change/set the present logon type ? ( I found, for example this: lsalogon example , but it doesn't compile because of missing header, includes, etc... not to mention, I'm not sure what login name/password to use. Is the login darkstar\andrew3 fine, or do I need to create some special admin account?
3) Does anyone know of a very simple program (source code) that I can compile from mingw to be able to access microsoft's pdb server? For if I have a program that I can compile with mingw / gcc / g++ -- I can use GDB to figure out exactly what is triggering the error message... but I can't debug cl.exe worth a darn using gdb; I really do need something with source code...
Any help, greatly appreciated.