Error 1305 The Revision Level Is Unknown
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up CreateProcessAsUser - Error 1305 up vote 0 down vote favorite 1 I have service and I need to run gui application with current user priveleges from this service. This is my code and it always returns GetLastError with 1305 CreateProcessAsUser fucntion. How I can fix it or may be my code isn't right and you can advice me something useful. Thx. void ConnectionManager::LaunchDialer () { HANDLE currentToken; HANDLE primaryToken; int dwSessionId = 0; PHANDLE hUserToken = 0; PHANDLE hTokenDup = 0; PWTS_SESSION_INFO pSessionInfo = 0; DWORD dwCount = 0; // Get the list of all terminal sessions WTSEnumerateSessions (WTS_CURRENT_SERVER_HANDLE, 0, 1, &pSessionInfo, &dwCount); int dataSize = sizeof (WTS_SESSION_INFO); // look over obtained list in search of the active session for (DWORD i = 0; i < dwCount; ++i) { WTS_SESSION_INFO si = pSessionInfo [i]; if (WTSActive == si.State) { // If the current session is active – store its ID dwSessionId = si.SessionId; break; } } WTSFreeMemory (pSessionInfo); // Get token of the logged in user by the active session ID BOOL bRet = WTSQueryUserToken (dwSessionId, ¤tToken); if (!bRet) { ModemDetectorService::instance ()->logMessage (QString ("WTSQueryUserToken: %1") .arg (GetLastError ())); return; } bRet = DuplicateTokenEx (currentToken, TOKEN_ASSIGN_PRIMARY | TOKEN_ALL_ACCESS, 0, SecurityImpersonation, TokenPrimary, &primaryToken); if (!bRet) { ModemDetectorService::instance ()->logMessage (QString ("DuplicateTokenEx: %1") .arg (GetLastError ())); return; } if (!primaryToken) { ModemDetectorService::instance ()->logMessage ("Invalid user token"); return; } STARTUPINFO StartupInfo; PROCESS_INFORMATION processInfo; ZeroMemory(&StartupInfo, sizeof(STARTUPINFO)); StartupInfo.cb= sizeof(STARTUPINFO); StartupInfo.lpDesktop = TEXT("winsta0\\default"); SECURITY_ATTRIBUTES Security1; SECURITY_ATTRIBUTES Security2; QSettings settings ("HKEY_LOCAL_MACHINE\\Software\\Olive\\OliveDialer", QSettings::NativeFormat); const QStr
size Print view FAQ Register Login Back to your Adiscon Loganalyzer instance ID 1305 REVISION LEVEL UNKNOWN Discuss Windows Event Log events. What they mean, what they tell you about your machine's security ... and whatever questions else you have. Moderator: alorbach Post a reply 7 posts • Page 1 of 1 Google Ads ID 1305 REVISION LEVEL UNKNOWN by nunes » Fri Apr 30, 2004 3:56 am Running W2K SP4 when trying to add computer to a domain or workgroup I get the error revision level unknown nunes Top revision level unknown by omega chris http://stackoverflow.com/questions/20984356/createprocessasuser-error-1305 » Thu Jul 08, 2004 2:57 am got same message in similar situation; however i had upgraded os from w2k to XPPro and had allowed os license to expire before reg. upgrade pkg. thoughts?? omega chris Top by Guest » Thu Oct 07, 2004 9:27 am same problem on school network over here.. i think its in the registry.. but the pc was first in http://kb.monitorware.com/1305-revision-level-unknown-t643.html a other domain and then i put a image of a other domain and now i get the revision level is unknown.. :S damnz fucked up Guest Top by Guest » Thu Oct 07, 2004 10:09 am hmm our pc worked again normaly afther we made the register size bigger.. Guest Top by therget » Wed Oct 20, 2004 10:56 am hmm I can't find anything useful about this error :? therget Frequent Poster Posts: 79Joined: Thu Dec 18, 2003 12:42 pm Top by guest » Wed Dec 15, 2004 6:48 pm http://miataru.computing.net/windows200 ... 53628.html guest Top by Guest » Wed Jan 12, 2005 6:41 am Anonymous wrote:same problem on school network over here.. i think its in the registry..but the pc was first in a other domain and then i put a image of a other domain and now i get the revision level is unknown.. :S damnz Guest Top Google Ads Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Post a reply 7 posts • Page 1 of 1 Return to Windows Events Jump to: Select a forum --------
Forum Visual C++ & C++ Programming Visual C++ Programming Error 1305 (ERROR_UNKNOWN_REVISION ) in SetSecurityDescriptorDacl function If this http://forums.codeguru.com/showthread.php?172262-Error-1305-(ERROR_UNKNOWN_REVISION-)-in-SetSecurityDescriptorDacl-function is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the http://vbcity.com/forums/t/104507.aspx register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 2 of 2 Thread: Error error 1305 1305 (ERROR_UNKNOWN_REVISION ) in SetSecurityDescriptorDacl function Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode March 15th, 2002,11:44 AM #1 Dullius View Profile View Forum Posts Junior Member Join Date Mar 2002 Posts 9 Error 1305 (ERROR_UNKNOWN_REVISION ) in SetSecurityDescriptorDacl function Hello I'm error 1305 the trying to set up a security structure to an event created in my application. But I'm getting the following error in the SetSecurityDescriptorDacl function: 1305 The revision level is unknown. ERROR_UNKNOWN_REVISION Can someone give some help? Follows the code Thank's P.S. Programming in VC++ 6.0 under WinNT 4.0 HANDLE evento; EXPLICIT_ACCESS ea[1]; PACL pACL = NULL; PSECURITY_DESCRIPTOR pSD = NULL; SECURITY_ATTRIBUTES sa; PSID pAdminSID = NULL; SID_IDENTIFIER_AUTHORITY SIDAuthNT = SECURITY_NT_AUTHORITY; DWORD dwRes; if(! AllocateAndInitializeSid( &SIDAuthNT, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pAdminSID) ) { printf( "AllocateAndInitializeSid Error %u\n", GetLastError() ); } ea[0].grfAccessPermissions = KEY_ALL_ACCESS; ea[0].grfAccessMode = SET_ACCESS; ea[0].grfInheritance= NO_INHERITANCE; ea[0].Trustee.TrusteeForm = TRUSTEE_IS_SID; ea[0].Trustee.TrusteeType = TRUSTEE_IS_GROUP; ea[0].Trustee.ptstrName = (LPTSTR) pAdminSID; dwRes = SetEntriesInAcl(1, ea, NULL, &pACL); if (ERROR_SUCCESS != dwRes) { printf( "SetEntriesInAcl Error %u\n", GetLastError() ); } pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH); if (pSD == NULL) { printf( "LocalAlloc Error %u\n", GetLastError() ); } //-- HERE IS WHERE I GET THE ERROR: if (!SetSecurityDescriptorDacl(pSD, TRUE, pACL, FALSE)) { printf( "SetSecurityDescriptorDacl Error %u\n", GetLastError()); } sa.nLength = sizeof (SECURITY_ATTRIBUTES); sa.lpSecuri
Replies | 1 Follower _eddyr Eindhoven, Netherlands Since 8/1/2005 Posts 4 Reputation 65 Reply Eduard Ramos (_eddyr) Posted: 8/2/2005 5:58 AM rated by 0 users modKern32.bas I try to start an application with CreateProcess but it just wont work! Even a simple application like "C:\windows\notepad.exe" doesn't start.I get the highly obscure error 1305: The revision level is unknown (ERROR_UNKNOWN_REVISION)Below two examples. Both fail with the same error 1305.Code: Dim lSuccess As LonglSuccess = CreateProcess(vbNullString, strCommand, sec1, sec2, False, _NORMAL_PRIORITY_CLASS, 0&, App.Path, startInfo, procInfo)Code:lSuccess = CreateProcess(vbNullString, cmdline$, 0&, 0&, 1&, _NORMAL_PRIORITY_CLASS, vbNullString, vbNullString, startInfo, procInfo)Any help is very welcome. I'm developing under a tight time scheme as always, you know.I attach a module with the full code listing.Thanks, Eddy. | Post Points: 20 msg555 Livonia Michigan, United States Since 2/29/2004 Posts 2,423 Reputation 24,835 Reply Mark Gordon (msg555) replied on 8/2/2005 6:56 AM rated by 0 users Can we see your declare(s) of CreateProcessHave you read the msdn documentation Quote:If lpProcessAttributes is NULL, the handle cannot be inherited.There may be more problems, but this will it least fix one, read the documentation and see if you can figure out what's wrong.lSuccess = CreateProcess(vbNullString, cmdline$, 0, 0, 0, _ NORMAL_PRIORITY_CLASS, vbNullString, vbNullString, startInfo, procInfo)If there is still a problem it has to do with how you filled startInfo, procInf, sec1, and sec2, or your declares of CreateProcess.what does cmdline equal? | Post Points: 5 _eddyr Eindhoven, Netherlands Since 8/1/2005 Posts 4 Reputation 65 Reply Eduard Ramos (_eddyr) replied on 8/10/2005 5:17 AM rated by 0 users Thanks guru (msg555) for the work.I have got this working now. Apparently it depends on the CurrentDirectory parameter. If I set this to a null string it doesnt work.That said: the commandline parameter is always the full path to the application, like prev example: "C:\windows\notepad.exe". The currentdirectory parameter then should be "C:\windows" or else the procedure doesn't work (in our environment = WinXP clients and WIN2003 domain server).I have both the CreateProcess and CreateProcessW