<?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[Ordner freigeben?]]></title><description><![CDATA[<p>Hiho!<br />
Ist es irgendwie möglich unter WinAPI Ordner in Windows freizugeben außer mit WinExec(net share...)? Optimal wäre ne funktion mit erweiterten einstellungen.<br />
Nutze WinXP.</p>
<p>mfg Perner</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/101093/ordner-freigeben</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Jul 2026 06:12:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/101093.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 13 Feb 2005 12:21:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 12:21:41 GMT]]></title><description><![CDATA[<p>Hiho!<br />
Ist es irgendwie möglich unter WinAPI Ordner in Windows freizugeben außer mit WinExec(net share...)? Optimal wäre ne funktion mit erweiterten einstellungen.<br />
Nutze WinXP.</p>
<p>mfg Perner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722108</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722108</guid><dc:creator><![CDATA[Perner]]></dc:creator><pubDate>Sun, 13 Feb 2005 12:21:41 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 12:27:59 GMT]]></title><description><![CDATA[<p>NetShareAdd</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722115</guid><dc:creator><![CDATA[hi progger]]></dc:creator><pubDate>Sun, 13 Feb 2005 12:27:59 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 13:26:44 GMT]]></title><description><![CDATA[<p>hab ich eben ausprobiert, aber scheint nur mit Win9x zu funzen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Gibts da keine funktion für 2k/XP?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722171</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722171</guid><dc:creator><![CDATA[Perner]]></dc:creator><pubDate>Sun, 13 Feb 2005 13:26:44 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 15:28:48 GMT]]></title><description><![CDATA[<p>Ahh, ich hatte nur die falsche lib gelinkt!<br />
Nachdem ich jetzt kompilieren konnte, kam mir schon der nächste Fehler entgegen, aber erstmal ein wenig Code:</p>
<pre><code>int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow )
{
   NET_API_STATUS res;
   SHARE_INFO_2 p;
   DWORD parm_err = 0;

      //
      // Fill in the SHARE_INFO_2 structure.
      //
      p.shi2_netname = TEXT(&quot;TESTSHARE&quot;);      
      p.shi2_type = STYPE_DISKTREE; // disk drive
      p.shi2_remark = TEXT(&quot;TESTSHARE to test NetShareAdd&quot;);
      p.shi2_permissions = 0;    
      p.shi2_max_uses = 4;
      p.shi2_current_uses = 0;    
      p.shi2_path = TEXT(&quot;C:\\&quot;);
      p.shi2_passwd = NULL; // no password
      //
      // Call the NetShareAdd function,
      //  specifying level 2.
      //
      res=NetShareAdd(NULL, 2, (LPBYTE)&amp;p, &amp;parm_err);
      //
      // If the call succeeds, inform the user.
      //

	  if(res==ERROR_INVALID_NAME)
		  MessageBox(0,&quot;Error im Filedings&quot;,&quot;0&quot;,0);

      if(res==0)
         MessageBox(0,&quot;Share created.\n&quot;,&quot;0&quot;,0);

      // Otherwise, print an error,
      //  and identify the parameter in error.
      //
      else
         MessageBox(0,&quot;Error&quot;,&quot;0&quot;,0);

....
return 0;
}
</code></pre>
<p>Das ist nahezu eine 1:1 übernahme der MSDN.<br />
Leider funktioniert es nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Als Fehler erhalte ich von der NetShareAdd funtion immer 123 bzw. ERROR_INVALID_NAME.<br />
woran könnte es liegen?</p>
<p>mfg Perner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722270</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722270</guid><dc:creator><![CDATA[Perner]]></dc:creator><pubDate>Sun, 13 Feb 2005 15:28:48 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 16:28:45 GMT]]></title><description><![CDATA[<p>Es wird öfters ein LPWSTR erwartet, also ein Pointer auf einen Unicode-String - TEXT macht das aber afaik nur, wenn du die UNICODE / _UNICODE Kontante definiert hast. Nur warum das im Beispiel auch so gemacht wird <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/722328</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722328</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 13 Feb 2005 16:28:45 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 17:16:24 GMT]]></title><description><![CDATA[<p>So tut das. Erst dann wird ein LPWSTR erwartet, wie flenders schon angedeutet hat.</p>
<pre><code class="language-cpp">#define UNICODE
#define FORCE_UNICODE

#include &lt;windows.h&gt;
#include &lt;lm.h&gt;

int APIENTRY WinMain(HINSTANCE hInstance, 
                     HINSTANCE hPrevInstance, 
                     LPSTR     lpCmdLine, 
                     int       nCmdShow ) 
{ 
	NET_API_STATUS res; 
	SHARE_INFO_2 p; 
	DWORD parm_err = 0; 

	// 
	// Fill in the SHARE_INFO_2 structure. 
	// 

	p.shi2_netname = TEXT(&quot;TESTSHARE&quot;);       
	p.shi2_type = STYPE_DISKTREE; // disk drive 
	p.shi2_remark = TEXT(&quot;TESTSHARE to test NetShareAdd&quot;); 
	p.shi2_permissions = 0;     
	p.shi2_max_uses = 4; 
	p.shi2_current_uses = 0;     
	p.shi2_path = TEXT(&quot;C:\\&quot;); 
	p.shi2_passwd = NULL; // no password 
	// 
	// Call the NetShareAdd function, 
	//  specifying level 2. 
	// 
	res=NetShareAdd(NULL, 2, (LPBYTE)&amp;p, &amp;parm_err); 
	// 
	// If the call succeeds, inform the user. 
	// 

	if(res==ERROR_INVALID_NAME) 
		MessageBox(0,TEXT(&quot;Error im Filedings&quot;),TEXT(&quot;0&quot;),0); 

	if(res==0) 
		MessageBox(0,TEXT(&quot;Share created.\n&quot;),TEXT(&quot;0&quot;),0); 

	// Otherwise, print an error, 
	//  and identify the parameter in error. 
	// 
	else 
		MessageBox(0,TEXT(&quot;Error&quot;),TEXT(&quot;0&quot;),0);
	return 0; 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/722362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722362</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Sun, 13 Feb 2005 17:16:24 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 17:18:54 GMT]]></title><description><![CDATA[<p>Anstatt TEXT zu benutzen wäre es intelligenter L&quot;&quot; zu benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722365</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722365</guid><dc:creator><![CDATA[foller]]></dc:creator><pubDate>Sun, 13 Feb 2005 17:18:54 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 17:20:48 GMT]]></title><description><![CDATA[<p>Dann kompiliert es nicht als ANSI-Version. Und die braucht man unter Win9x.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722366</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Sun, 13 Feb 2005 17:20:48 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 17:26:08 GMT]]></title><description><![CDATA[<p>SHARE_INFO_2 gibts eh nur in der NT-Reihe.<br />
Und dort wird immer ein Widestring verlangt.</p>
<p>Keine Ahnung wie man das unter Win 9x macht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722368</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722368</guid><dc:creator><![CDATA[foller]]></dc:creator><pubDate>Sun, 13 Feb 2005 17:26:08 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Sun, 13 Feb 2005 17:28:33 GMT]]></title><description><![CDATA[<p>ok, unter win 9x braucht man share_info_50.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722372</guid><dc:creator><![CDATA[foller]]></dc:creator><pubDate>Sun, 13 Feb 2005 17:28:33 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Mon, 14 Feb 2005 12:34:03 GMT]]></title><description><![CDATA[<p>danke für die Zahlreichen Antworten, doch trotz</p>
<pre><code>#define UNICODE
#define FORCE_UNICODE
</code></pre>
<p>Schmeißt mir die NetShareAdd funktion den Fehlercode 123 raus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Dieses Problem hab ich allerdings auch an den Rechnern in meiner Schule, also kanns an meinem Rechner nicht liegen. Das ist bestimmt wieder so n mini fehler der sich einfach nicht finden lässt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/722961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722961</guid><dc:creator><![CDATA[Perner]]></dc:creator><pubDate>Mon, 14 Feb 2005 12:34:03 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Mon, 14 Feb 2005 14:01:51 GMT]]></title><description><![CDATA[<p>Also den Quellcode, den ich gepostet habe, solltest du 1:1 übernehmen können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/723028</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723028</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Mon, 14 Feb 2005 14:01:51 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Mon, 14 Feb 2005 17:13:34 GMT]]></title><description><![CDATA[<p>Also ich habe jetzt folgendes Programm:</p>
<pre><code>#define UNICODE
#define FORCE_UNICODE

#include &quot;stdafx.h&quot;
#include &lt;windows.h&gt;
#include &lt;lm.h&gt;

#pragma comment(lib, &quot;Netapi32.lib&quot;)

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow )
{
    NET_API_STATUS res;
    SHARE_INFO_2 p;
    DWORD parm_err = 0;

    //
    // Fill in the SHARE_INFO_2 structure.
    //

    p.shi2_netname = TEXT(&quot;TESTSHARE&quot;);      
    p.shi2_type = STYPE_DISKTREE; // disk drive
    p.shi2_remark = TEXT(&quot;TESTSHARE to test NetShareAdd&quot;);
    p.shi2_permissions = 0;    
    p.shi2_max_uses = 4;
    p.shi2_current_uses = 0;    
    p.shi2_path = TEXT(&quot;C:\\&quot;);
    p.shi2_passwd = NULL; // no password
    //
    // Call the NetShareAdd function,
    //  specifying level 2.
    //
    res=NetShareAdd(NULL, 2, (LPBYTE)&amp;p, &amp;parm_err);
    //
    // If the call succeeds, inform the user.
    //

    if(res==ERROR_INVALID_NAME)
        MessageBox(0,TEXT(&quot;Error im Filedings&quot;),TEXT(&quot;0&quot;),0);

    if(res==0)
        MessageBox(0,TEXT(&quot;Share created.\n&quot;),TEXT(&quot;0&quot;),0);

    // Otherwise, print an error,
    //  and identify the parameter in error.
    //
    else
        MessageBox(0,TEXT(&quot;Error&quot;),TEXT(&quot;0&quot;),0);
    return 0;
}
</code></pre>
<p>Jedoch erhalte ich, aus mir unerfindlichen gründen, immernoch den 123 fehler <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /><br />
Hats bei dir funktioniert <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/963">@dEUs</a>? Und wenn ja, welches OS hast du?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/723215</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723215</guid><dc:creator><![CDATA[Perner]]></dc:creator><pubDate>Mon, 14 Feb 2005 17:13:34 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Mon, 14 Feb 2005 17:29:18 GMT]]></title><description><![CDATA[<p>Der Code tut bei mir. OS ist WinXP Pro SP2.<br />
IDE ist VC++ 6.0 oder <a href="http://VS.NET" rel="nofollow">VS.NET</a> 2003.<br />
Allerdings schlägt NetShareAdd fehl, wenn die Freigabe bereits existiert. Allerdings nicht mit 123.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/723223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723223</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Mon, 14 Feb 2005 17:29:18 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Mon, 14 Feb 2005 19:27:48 GMT]]></title><description><![CDATA[<p>Komisch, ich habe auch WinXP und den VC++ 6.0, allerdings SP1 aber daran wird es nicht liegen. Ich versteh es net <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/723339</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/723339</guid><dc:creator><![CDATA[Perner]]></dc:creator><pubDate>Mon, 14 Feb 2005 19:27:48 GMT</pubDate></item><item><title><![CDATA[Reply to Ordner freigeben? on Wed, 05 Oct 2005 20:37:19 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich hab folgendes Problem zu der Thematik:</p>
<p>Alle Freigaben, die mit NetShareAdd erstellt werden, lassen <strong>nur Vollzugriff</strong> zu.<br />
Also auch beim Setzen von <strong>shi2_permissions = ACCESS_READ</strong>.<br />
Dasselbe geschieht beim Benutzen der Fkt NetShareSetInfo.</p>
<p>In der MSDN ist von einer SECURITY_DESCRIPTOR - Struktur die Rede.<br />
Weiß jemand wie und wo man diese einbinden soll? Ich werde da nicht schlau daraus.<br />
Oder weiß jemand, wie man die ReadOnly Eigenschaft der Freigabe setzen kann?</p>
<p>Danke im Voraus.<br />
MfG.<br />
DaGus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/886049</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/886049</guid><dc:creator><![CDATA[DaGus]]></dc:creator><pubDate>Wed, 05 Oct 2005 20:37:19 GMT</pubDate></item></channel></rss>