TEvg>C какой радости?
А с такой - другого пути нет. Или драйвер специальный свой, или системный. Слой абстракции железа не пускает работать напрямую с железом иначе как через его API - только драйвер и работает на уровне железа. Этим NT/2000/XP и отличаются от 95/98.
>>A client must open a file on a parallel port before the client can use other I/O requests or use the parallel port callback routinesTEvg>Речь идет о LPT.
А не важно - я просто показал, что от порта не зависит.
>>A user-mode client must use the Win32 Communications APITEvg>Не вижу слово file.
Женя, залезте в MSDN и посмотрите определение Win32 Communications API - там файловые операции (общение с драйвером тоже происходит через его открытие как файла - таким образом, понятие файла немного шире обычного - сродни Юниху), сокеты и пара специальных.
TEvg>Интересно можно ли открыв файл произвольно менять уровни сигналов DTR, RTS, RI..?
Можно - через DeviceIOControl. Вот вам опять пара цитат из мсдн -
Platform SDK: Device I/O
Calling DeviceIoControl
Windows NT/2000/XP
An application can use the DeviceIoControl function to perform direct input and output operations on, or retrieve information about, a floppy disk drive, hard disk drive, tape drive, or CD-ROM drive. The following example demonstrates how to retrieve information about the first physical drive in the system. It uses the CreateFile function to retrieve the device handle to the first physical drive, and then uses DeviceIoControl with the IOCTL_DISK_GET_DRIVE_GEOMETRY control code to fill a DISK_GEOMETRY structure with information about the drive.
/* The code of interest is in the subroutine GetDriveGeometry. The
code in main shows how to interpret the results of the IOCTL call. */
#include <windows.h>
#include <winioctl.h>
BOOL GetDriveGeometry(DISK_GEOMETRY *pdg)
{
HANDLE hDevice; // handle to the drive to be examined
BOOL bResult; // results flag
DWORD junk; // discard results
hDevice = CreateFile("\.PhysicalDrive0", // drive to open
0, // no access to the drive
FILE_SHARE_READ | // share mode
FILE_SHARE_WRITE,
NULL, // default security attributes
OPEN_EXISTING, // disposition
0, // file attributes
NULL); // do not copy file attributes
if (hDevice == INVALID_HANDLE_VALUE) // cannot open the drive
{
retun (FALSE);
}
[ слишком длинный топик - автонарезка ]