<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[UAC - oder wie registriere ich einfach COM ohne separaten prozess]]></title><description><![CDATA[<p>Meine frage rankt sich um den Mythos UAC:</p>
<p>Ich möchte ohne einen zweiten prozess zu benutzen müssen, die rechte meiner<br />
Anwendung mit zustimmmung des benutzers erhöhen.</p>
<p>Ist das möglich?<br />
Ich bin jetzt gerade irgendwo bei SE_TAKE_OWNERSHIP und WRITE_OWNER gelandet,<br />
gibt es aber irgendeinen weg das anders zu machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/213363/uac-oder-wie-registriere-ich-einfach-com-ohne-separaten-prozess</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 15:17:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/213363.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 May 2008 21:11:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Fri, 16 May 2008 21:11:17 GMT]]></title><description><![CDATA[<p>Meine frage rankt sich um den Mythos UAC:</p>
<p>Ich möchte ohne einen zweiten prozess zu benutzen müssen, die rechte meiner<br />
Anwendung mit zustimmmung des benutzers erhöhen.</p>
<p>Ist das möglich?<br />
Ich bin jetzt gerade irgendwo bei SE_TAKE_OWNERSHIP und WRITE_OWNER gelandet,<br />
gibt es aber irgendeinen weg das anders zu machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1510790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1510790</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Fri, 16 May 2008 21:11:17 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Fri, 16 May 2008 21:14:27 GMT]]></title><description><![CDATA[<p>geht das vllt. mit SetThreadToken?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1510792</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1510792</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Fri, 16 May 2008 21:14:27 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Fri, 16 May 2008 21:23:55 GMT]]></title><description><![CDATA[<p>problem hat sich selbst gelöst:<br />
CredUI...<br />
LogonUser<br />
SetThreadToken...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1510798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1510798</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Fri, 16 May 2008 21:23:55 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Sat, 17 May 2008 16:32:37 GMT]]></title><description><![CDATA[<p>Nach tieferer penetration der security API bin ich auf folgendes problem gestoßen:<br />
ERROR_BAD_IMPERSONATION_LEVEL</p>
<p>Dieses problemchen lässt sich irgendwie nicht lösen, zur verdeutlichung nun mal etwas code:</p>
<pre><code class="language-cpp">int main(int argc, TCHAR* argv[])
{
WCHAR userName[CREDUI_MAX_USERNAME_LENGTH + 1];
WCHAR password[CREDUI_MAX_PASSWORD_LENGTH + 1];
WCHAR computerName[MAX_COMPUTERNAME_LENGTH + 2];
DWORD rv, dw1;
HANDLE hThr, hToken;

// Leeren...
ZeroMemory(userName, sizeof(userName));
ZeroMemory(password, sizeof(password));
// Computername beschaffen
dw1 = MAX_COMPUTERNAME_LENGTH + 1;
GetComputerName(computerName, &amp;dw1);
// Credentials aus console lesen
rv = CredUICmdLinePromptForCredentials(computerName, NULL,
    0, userName, CREDUI_MAX_USERNAME_LENGTH,
    password, CREDUI_MAX_PASSWORD_LENGTH, NULL,
    CREDUI_FLAGS_DO_NOT_PERSIST | CREDUI_FLAGS_EXCLUDE_CERTIFICATES);
// Logon um impersonation token zu bekommen(durch LONGON_NETWORK)
LPCWSTR lpUn = wcschr(userName, L'\\');
if(!lpUn)
    lpUn = userName;
LogonUser(lpUn, NULL, password, LOGON32_LOGON_NETWORK,
    LOGON32_PROVIDER_DEFAULT, &amp;hToken);
rv = GetLastError();
// Password/Name ausm speicher
SecureZeroMemory(password, sizeof(password));
SecureZeroMemory(userName, sizeof(userName));
// Thread handle für nacher holen
hThr = GetCurrentThread();

// Datei ohne impersonation(-&gt;ohne rechte) öffnen
BOOL file_test();
BOOL bl = file_test();

// Impersonation
SetThreadToken(&amp;hThr, hToken);

// Datei theoretisch mit dem richtigen user öffnen
bl = file_test();

// Revert to self ähnlich
SetThreadToken(&amp;hThr, NULL);
CloseHandle(hToken);
return 0;
}

BOOL file_test()
{
    LPCTSTR lpHardcodedFileName = TEXT(&quot;&quot;);
    HANDLE hFil = CreateFile(lpHardcodedFileName,
        GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
    DWORD dwErr = GetLastError(); // !!! 1: AccessDenied; 2: BadImpers...
    if(hFil == INVALID_HANDLE_VALUE)
        return FALSE;
    CloseHandle(hFil);
    return TRUE;
}
</code></pre>
<p>Bei den !! ist der wurm drin</p>
<p>Man dankt für hilfsbereite antworten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511115</guid><dc:creator><![CDATA[wurst-reloaded]]></dc:creator><pubDate>Sat, 17 May 2008 16:32:37 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Sat, 17 May 2008 19:32:35 GMT]]></title><description><![CDATA[<p>Ich möchte jetzt nicht unhöflich oder ungeduldig wirken, aber könnte jemand der Ahnung hat bitte antworten? Weil bei so pille-palle wie float in string wird ja auch fleißig geantwortet. (in view count, wie in forentechnik vorgeschlagen wäre wirklich ganz nett).</p>
<p>Und bitte das hier jetzt nicht als abwertend/etc. werten(einfache probleme sind ja auch probleme), danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511186</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511186</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Sat, 17 May 2008 19:32:35 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Sat, 17 May 2008 21:21:00 GMT]]></title><description><![CDATA[<p>Der offizielle Weg ist einen separaten Process mittels &quot;ShellExecutE2 und dem Verb &quot;runas&quot; zu starten; dass muss nicht ein separater Process sein, es kann auch der gleiche sein, z.B. nur mit einem zusätzlichen Parameter, z.B.:</p>
<pre><code>Myapp.exe /regserver
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1511242</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511242</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sat, 17 May 2008 21:21:00 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Sun, 18 May 2008 16:35:27 GMT]]></title><description><![CDATA[<p>Dankeschön. Jetzt haben sich aber meine Anforderungen geändert, weil ich wissen will wie man Impersonation macht, bzw. was ich daran falsch mache. Da hat jetzt den wichtigeren Platz eingenommen.</p>
<p>Danke schon einmal im vo<strong>rr</strong>aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511678</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511678</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Sun, 18 May 2008 16:35:27 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Sun, 18 May 2008 16:46:55 GMT]]></title><description><![CDATA[<p>wurst schrieb:</p>
<blockquote>
<p>Weil bei so pille-palle wie float in string wird ja auch fleißig geantwortet.</p>
</blockquote>
<p>Hiermit kennen sich nunmal nicht besonders viele aus..</p>
<p>Eventuell überflüssige Frage aber man weiß ja nie: Ist dein geposteter Code auch der, den du einsetzt? Ich frage, weil dort die Rückgabewerte ja gar nicht geprüft werden (z.B. von SetThreadToken).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511687</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511687</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sun, 18 May 2008 16:46:55 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Sun, 18 May 2008 17:48:29 GMT]]></title><description><![CDATA[<p>Das ist nur zum testen und den rückgabewert habe ich im debuggr ja im eax register, das ist kein problem.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511736</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Sun, 18 May 2008 17:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Mon, 19 May 2008 12:32:19 GMT]]></title><description><![CDATA[<p>Ich hab nun zur vergrößerung des publikums die geschichte auch noch bei MS gepostet:<br />
<a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=116&amp;SiteID=1" rel="nofollow">http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=116&amp;SiteID=1</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1512216</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1512216</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Mon, 19 May 2008 12:32:19 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Mon, 19 May 2008 12:56:17 GMT]]></title><description><![CDATA[<p>Hast du bei &quot;LogonUser&quot; mal ein anderes Flag probiert als LOGON32_LOGON_NETWORK? Und warum gibst du hier weniger Informationen als im MSDN-Forum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1512248</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1512248</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Mon, 19 May 2008 12:56:17 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Mon, 19 May 2008 13:02:01 GMT]]></title><description><![CDATA[<p>Ich hab schon so ziemlich jede Logon art versucht. Bei LOGON_INTERACTIVE/BATCH bekommt man ein primary token, welches man dass durch DuplicateToken in ein impersonations token umwandeln muss/soll(da habe ich auch schon zig kombinationen ausprobiert).</p>
<p>Ich glaube ich sollte das so langsam irgendwie in klassen packen, und dann zigtausende zufällige kombinationen ausprobieren, bis es funktioniert...</p>
<p>(zu den informationen: das mit dem überprüfen des tokens habe ich erst später angefangen(in dem ausmaß))</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1512257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1512257</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Mon, 19 May 2008 13:02:01 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Mon, 19 May 2008 13:13:53 GMT]]></title><description><![CDATA[<p>Hast du mal versucht, der Funktion SetThreadToken ein Primary Token zu übergeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1512272</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1512272</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Mon, 19 May 2008 13:13:53 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Mon, 19 May 2008 13:20:09 GMT]]></title><description><![CDATA[<p>Ja, dadurch funktioniert das GetTokenInfo mit den Privileges, der ImpersonationLevel aufruf aber nicht. (Alle funktionen sind erfolgreich, außer eben die, die nach dem ImpersonationLevel fragt, das Lookup...Name schlägt trotzdem fehl).</p>
<p>Und der dateitest gibt wieder ERROR_BAD_INPERSONATION_LEVEL zurück.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1512276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1512276</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Mon, 19 May 2008 13:20:09 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Mon, 19 May 2008 13:41:40 GMT]]></title><description><![CDATA[<p>Soweit ich weiß, kann man Teile eines Prozesses unter Vista mit UAC nicht mehr dynamisch anheben. Der ganze Prozess läuft nur mit den Rechten, mit denen er gestartet wird. Abhilfe schafft nur, den entsprechenden Code in einen zweiten Prozess auszulagern, der dann mit &lt;requireAdministrator&gt; gestartet wird oder die Verwendung von einem COM-Objekt, welches ebenfalls in einem externen Prozess gestartet wird (meistens dllhost.exe).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1512290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1512290</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Mon, 19 May 2008 13:41:40 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Mon, 19 May 2008 13:51:19 GMT]]></title><description><![CDATA[<p>Joar, scheint wohl wirklich so zu sein.</p>
<p><a href="http://weblogs.asp.net/kennykerr/archive/2006/09/29/Windows-Vista-for-Developers-" rel="nofollow">http://weblogs.asp.net/kennykerr/archive/2006/09/29/Windows-Vista-for-Developers-</a><em>1320</em>-Part-4-<em>1320</em>-User-Account-Control.aspx schrieb:</p>
<blockquote>
<p>You can change the integrity level when a process is created but not once it has been created.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1512295</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1512295</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Mon, 19 May 2008 13:51:19 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Mon, 19 May 2008 14:55:52 GMT]]></title><description><![CDATA[<p>dann ist doch die ganze impersonation für'n a.<br />
Was will man machen, auf zum separaten prozess.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1512356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1512356</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Mon, 19 May 2008 14:55:52 GMT</pubDate></item><item><title><![CDATA[Reply to UAC - oder wie registriere ich einfach COM ohne separaten prozess on Mon, 19 May 2008 15:19:50 GMT]]></title><description><![CDATA[<p>Also ich hab gerade das token mal etwas überprüft und anscheinend hat es ein integrity level von untrusted. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1512380</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1512380</guid><dc:creator><![CDATA[wurst]]></dc:creator><pubDate>Mon, 19 May 2008 15:19:50 GMT</pubDate></item></channel></rss>