parallel & serial port questions

Win32 Programming


  • 1. EnumProcesses
    I use EnumProcesses continuously in a loop, since I need to catch a certain process right after being launched. Then on every process id I check whether its the right one. I'm looking for a way to shorten the time of this discovery. For instance check only new processes, check only certain ID's etc. Have you any idea to help me? Thanks in advance Mandi
  • 2. OpenSCManager and Error 1726
    I am making a call to OpenSCManager on a remote machine. On occasion the return handle is NULL and after checking the last error it says error 1726 (The remote procedure call failed.). If I immediatly call OpenSCManager again it works. I have no explanation for this behaviour. If someone has an explanation for this I would really appreciate knowing what the cause is. Before the call an IPC$ Connection has been made. hM = OpenSCManager(strMachineName, NULL, SC_MANAGER_ALL_ACCESS); if (hM == NULL) { Err - GetLastError(); if (Err == 1726) { // Why would this work if the above call failed?????????? hM = OpenSCManager(strMachineName, NULL, SC_MANAGER_ALL_ACCESS); } } Thanks
  • 3. Unicode data for DdeCreateDataHandle() call
    Hi, How can I create a Unicode data handle? We used to call DdeCreateDataHandle() and subsequent DdeClientTransaction() before we ported to Unicode, such as, LPCTSTR lpszString = T2A((LPTSTR)(LPCTSTR) strString ); HDDEDATA hData1 = DdeCreateDataHandle( m_dwID, (unsigned char*)lpszString, (_tcslen( lpszString )+1)*sizeof(TCHAR), 0L, 0L, 0, 0 ); HDDEDATA hData2 = DdeClientTransaction( (LPBYTE)hData1, .......); Now with _UNICODE defined, the above stopped working. Is there anything I miss? TIA.
  • 4. SFilter detach on shutdown problem
    Hello. I'm using sfilter (filter-high) from "NT File System Internals" book as a basis for my filter driver. The problem I found that this sample produce BSOD on system shutdown. It's happend in the folowing call stack: SFilterFastIoDetachDevice(fastio.c) -> SFilterDetachTarget(attach.c) -> IoDetachDevice Does anybody knows the reason?

parallel & serial port questions

Postby Lem » Mon, 03 May 2004 21:11:32 GMT

How do I write directly to the printer, ie, to createfile on the parallel
port and write directly to it.  Is it possible?
What is the filename parameter for the COM1 serial port in createfile()?
Where can I find the respective filenames for the communication devices?
The Win32sdk help does not seem very helpful.

Thanks in advance

Re: parallel & serial port questions

Postby John Phillips » Sun, 09 May 2004 07:24:01 GMT

You can open a serial port or parallel port by specifying \\.\COM1 or
\\.\LPT1 respectively (these examples open the first serial and parallel
port on the system, adjust the numbering as required).

For serial communication, you need to configure the port.  Check out the
"Communication Functions" section of MSDN.

There are some "gotchas" when trying to use parallel ports.  Google for the
rather lengthy "Parallel Port" thread in this group about a year ago.

John Phillips
MVP - Windows SDK

Return to Win32 Programming


Who is online

Users browsing this forum: No registered users and 74 guest