<?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[Bits eines Druckerports einlesen&#x2F;ausgeben]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Kann mir vielleicht jemand sagen wie ich möglichst simpel einzelne Bits des Druckerports setzen und auslesen kann? Der Port hängt an keinem Drucker. Es soll einfach nur mit selbst gebauter Hardware kommuniziert werden.</p>
<p>Hab schon ordentlich gegooglet aber leider nichts passendes gefunden.</p>
<p>Betriebssystem: Win XP</p>
<p>Hoffen jemand kann mir helfen.</p>
<p>Vielen Dank schonmal.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/226229/bits-eines-druckerports-einlesen-ausgeben</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 10:46:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/226229.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Oct 2008 19:54:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Thu, 30 Oct 2008 19:54:21 GMT]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Kann mir vielleicht jemand sagen wie ich möglichst simpel einzelne Bits des Druckerports setzen und auslesen kann? Der Port hängt an keinem Drucker. Es soll einfach nur mit selbst gebauter Hardware kommuniziert werden.</p>
<p>Hab schon ordentlich gegooglet aber leider nichts passendes gefunden.</p>
<p>Betriebssystem: Win XP</p>
<p>Hoffen jemand kann mir helfen.</p>
<p>Vielen Dank schonmal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1607447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1607447</guid><dc:creator><![CDATA[dahaack]]></dc:creator><pubDate>Thu, 30 Oct 2008 19:54:21 GMT</pubDate></item><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Fri, 31 Oct 2008 06:57:32 GMT]]></title><description><![CDATA[<p>CreateFile, ReadFile, WriteFile. Du liest/schreibst dann natürlich byteweise und musste eben mit Bitoperationen arbeiten.</p>
<p>Hier gibt's weiter unten ein Beispiel:</p>
<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39403-and-start-is-0.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-39403-and-start-is-0.html</a></p>
<p>_inp/_outp funktionieren nur auf alten Betriebssystemen wie Win98, also probier's erst gar nicht... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1607805</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1607805</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Fri, 31 Oct 2008 06:57:32 GMT</pubDate></item><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Fri, 31 Oct 2008 07:55:03 GMT]]></title><description><![CDATA[<p>topic: <a href="http://electrosofts.com/parallel/" rel="nofollow">http://electrosofts.com/parallel/</a></p>
<p>_matze schrieb:</p>
<blockquote>
<p>_inp/_outp funktionieren nur auf alten Betriebssystemen wie Win98, also probier's erst gar nicht</p>
</blockquote>
<p>unter xp geht's auch, zwar muss man bestimmte tricks anwenden, aber dann klappen selbst assembler in/out-instructions aus dem user mode.<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1607822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1607822</guid><dc:creator><![CDATA[~fricky]]></dc:creator><pubDate>Fri, 31 Oct 2008 07:55:03 GMT</pubDate></item><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Fri, 31 Oct 2008 08:25:14 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-2713.html" rel="nofollow">Nobuo T</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-10.html" rel="nofollow">ANSI C</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1607847</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1607847</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Fri, 31 Oct 2008 08:25:14 GMT</pubDate></item><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Fri, 31 Oct 2008 08:29:56 GMT]]></title><description><![CDATA[<p>~fricky schrieb:</p>
<blockquote>
<p>topic: <a href="http://electrosofts.com/parallel/" rel="nofollow">http://electrosofts.com/parallel/</a></p>
<p>_matze schrieb:</p>
<blockquote>
<p>_inp/_outp funktionieren nur auf alten Betriebssystemen wie Win98, also probier's erst gar nicht</p>
</blockquote>
<p>unter xp geht's auch, zwar muss man bestimmte tricks anwenden, aber dann klappen selbst assembler in/out-instructions aus dem user mode.<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
</blockquote>
<p>Welche Tricks sind das? Ich kenne dafür nur die InpOut32.dll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1607850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1607850</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Fri, 31 Oct 2008 08:29:56 GMT</pubDate></item><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Fri, 31 Oct 2008 14:53:19 GMT]]></title><description><![CDATA[<p><a href="http://wookey.org/usermodehardwareportio.html" rel="nofollow">http://wookey.org/usermodehardwareportio.html</a><br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1608120</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1608120</guid><dc:creator><![CDATA[~fricky]]></dc:creator><pubDate>Fri, 31 Oct 2008 14:53:19 GMT</pubDate></item><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Sat, 01 Nov 2008 11:25:46 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &lt;windows.h&gt;
#include &lt;lmcons.h&gt; // missing from mstask.h
#include &lt;mstask.h&gt;
#include &lt;lmat.h&gt;
#include &lt;wchar.h&gt;
#include &lt;conio.h&gt; // kbhit
#pragma comment(lib, &quot;netapi32.lib&quot;)
#pragma comment(lib, &quot;mstask.lib&quot;)
#pragma comment(lib, &quot;D:\\WINDDK\\3790.1830\\lib\\wxp\\i386\\ntdll.lib&quot;)
extern &quot;C&quot; int __declspec(dllimport) __stdcall ZwSetInformationProcess(int,int,void*,int);
#define ZwCurrentProcess() -1
#define ProcessUserModeIOPL 16

int SystemMain(int argc, _TCHAR* argv[])
{
	_putws(L&quot;toggling LPT bits. Press any key to quit&quot;);
	while (!_kbhit())
	{
		Beep(900,40);
		_outp(888, 255);
		Sleep(200);

		Beep(900,40);
		_outp(888, 0);
		Sleep(200);
	}
	return 0;
}

int _tmain(int argc, _TCHAR* argv[])
{
	WCHAR text[32];
	DWORD cch = 32;
	GetUserName(text, &amp;cch);

	if (!_wcsicmp(text, L&quot;SYSTEM&quot;))
	{
		int IOPL = 3;
		ZwSetInformationProcess(ZwCurrentProcess(), ProcessUserModeIOPL, &amp;IOPL, 4);
		return SystemMain(argc, argv);
	}

	// Taskplaner service soll gestarten werden
	AT_INFO at = {0,0,0,0,GetCommandLine()};
	DWORD dwJob;
	CoInitialize(NULL);

	NET_API_STATUS status = NetScheduleJobAdd(NULL, (byte*)&amp;at, &amp;dwJob);
	if (status == 2184)
	{
		// this is temporary! You should use StartService()
		system(&quot;sc start schedule&quot;);
		Sleep(1000);
		status = NetScheduleJobAdd(NULL, (byte*)&amp;at, &amp;dwJob);
	}

	if (!status)
	{
		// job name
		wsprintf(text, L&quot;At%d&quot;, dwJob);

		ITaskScheduler *scheduler;
		if (!CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, IID_ITaskScheduler, (void**)&amp;scheduler))
		{
			ITask *task;
			if (!scheduler-&gt;Activate(text, IID_ITask, (IUnknown**)&amp;task))
			{
				if (!task-&gt;Run())
				{
					// task is queued for run, wait a little
					HRESULT hrStatus = SCHED_S_TASK_HAS_NOT_RUN;
					BOOL fWait = TRUE;
					while (fWait)
					{
						Sleep(200);
						ITask *task2;
						if (scheduler-&gt;Activate(text, IID_ITask, (IUnknown**)&amp;task2))
							break;

						task2-&gt;GetStatus(&amp;hrStatus);

						if (hrStatus != SCHED_S_TASK_HAS_NOT_RUN)
							fWait = FALSE;

						task2-&gt;Release();
					}
				}
				task-&gt;Release();
			}
			scheduler-&gt;Delete(text);
			scheduler-&gt;Release();
		}
	}
	CoUninitialize(); 
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1608462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1608462</guid><dc:creator><![CDATA[sapero]]></dc:creator><pubDate>Sat, 01 Nov 2008 11:25:46 GMT</pubDate></item><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Sat, 01 Nov 2008 20:16:31 GMT]]></title><description><![CDATA[<p>Hallo.</p>
<p>Wenn du mit einem bisschen &quot;rumgebeepe&quot; zufrienden bist, lies lieber nicht weiter. Nicht alle Assembler-Instruktionen sind privilegiert!</p>
<p>Ich vermute mal, du willst direkt die Register des Schnittstellen-ICs ansprechen (oder den 16550, oder, oder, oder ... die untersten 64 K des BIOS). Das das nicht mehr geht, hat nur bedingt mit dem OS zu tun. Es war eine Vereinbarung zwischen Intel und Microsoft. Der normale Progger kennt das als</p>
<p>USER-MODE (UM)</p>
<p>und</p>
<p>PROTECTED_MODE (PM).</p>
<p>Soll eine Variable X addressiert werden, entscheidet der Prozessor anhand seines Modus (UM/PM) und den Bits 0 und 1 der Addresse (stark vereinfacht), ob das Programm das überhaupt darf (UM: ja, PM: nein).<br />
Diese zwei Bits repräsentieren vier Privilegien (auch stark vereinfacht):</p>
<p>0: Kernel (= Hardware),<br />
1: Driver,<br />
2: Konsole,<br />
3: Dein Win32-Programm mit schickem Fenster.</p>
<p>Willst Du nun im PM von 3 auf 0 zugreifen, bekommst du eine Exception direkt vom Prozessor: EXCEPTION_PRIVILEGE_resthabichvergessen.<br />
Das kommt aus der <strong>PrivilegeMap</strong>. Jede Addresse in den untersten 64 K ist in der Map durch ein Bit vertreten: Bit gesetzt = kein Zugriff.<br />
Um das Bit zu löschen, brauchst du einen Treiber (Level 1), der das Bit löscht. Kleines Beispiel in deiner Sache:</p>
<p>Du willst auf die Addressen 0378 - 037B (hex, Register LPT1) zugreifen. Über Win32 hast du keine Chance. Also nimmst du den &quot;Service&quot; GIVEIO.SYS. Der setzt dir die o.g. Bitmap komplett auf 0 (Random Access auf HardWare). Jetzt funktionieren alle privilegierten Assembler-Instruktionen (z.B. IN/OUT) wieder.</p>
<p>Handhabung:</p>
<p>0. giveio.sys ins system32<br />
1. CreateFile(&quot;\\\giveio.sys\&quot;, ...); (das mit den Backslashes kann ich mir nicht merken, sorry. Guckst du MSDN)<br />
2. Treiber muss gestartet sein (OpenSCManager oder Start-&gt;Systemsteuerung-&gt;...)<br />
3. Have fun and if u dont have the knowledge, use acronis before.</p>
<p><strong>VORSICHT! VORSICHT! VORSICHT! Du konkurrierst mit deinem BIOS !!!!!!!!!!!!!</strong></p>
<p>Gruß</p>
<p>Lars</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1608730</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1608730</guid><dc:creator><![CDATA[chezzmatazz]]></dc:creator><pubDate>Sat, 01 Nov 2008 20:16:31 GMT</pubDate></item><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Sat, 01 Nov 2008 20:23:45 GMT]]></title><description><![CDATA[<p>1. Die ausfühliche Erklärung steht im Datenblatt vom jeweiligen Intel-Prozessor (selten weniger als 4000 Seiten). Viel Spass beim Lesen.</p>
<p>2. Experiment:</p>
<p>- Starte dein Programm (mit GIVEIO.SYS)<br />
- Starte einen lange dauernden Druckjob<br />
- funke mal dem Spooler dazwischen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1608731</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1608731</guid><dc:creator><![CDATA[chezzmatazz]]></dc:creator><pubDate>Sat, 01 Nov 2008 20:23:45 GMT</pubDate></item><item><title><![CDATA[Reply to Bits eines Druckerports einlesen&#x2F;ausgeben on Sat, 01 Nov 2008 20:56:34 GMT]]></title><description><![CDATA[<p>... sieht so aus</p>
<p>__asm<br />
assembly-language-instruction</p>
<p>__asm<br />
{<br />
assembly-language-instructions<br />
}</p>
<p>(MSDN)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1608735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1608735</guid><dc:creator><![CDATA[chezzmatazz]]></dc:creator><pubDate>Sat, 01 Nov 2008 20:56:34 GMT</pubDate></item></channel></rss>