From: <lab...@us...> - 2004-03-10 13:00:32
|
Update of /cvsroot/opengtoolkit/portIO/c_source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18303/c_source Modified Files: ogportiodll.c ogportiodll.h Log Message: Added function to DLL to reset the port IO map for a process Index: ogportiodll.c =================================================================== RCS file: /cvsroot/opengtoolkit/portIO/c_source/ogportiodll.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ogportiodll.c 3 Mar 2004 13:20:24 -0000 1.1 --- ogportiodll.c 10 Mar 2004 12:42:32 -0000 1.2 *************** *** 425,428 **** --- 425,459 ---- } + DWORD LibAPI PortIODisableAll(unsigned long processID) + { + DWORD BytesReturned, err = ERROR_SUCCESS; + + if (gWinNT) + { + PORTMAP param; + + if (hDevice == INVALID_HANDLE_VALUE) + { + err = PortIOOpen(); + if (err) return err; + } + + param.processID = processID; + + if (!DeviceIoControl(hDevice, + IOCTL_RESET_IOPM, + ¶m, + sizeof(PORTMAP), + NULL, + 0, + &BytesReturned, + NULL)) + { + err = GetLastError(); + } + } + return err; + } + DWORD LibAPI PortIOReadDirect(unsigned short address, unsigned long size, void *value) { Index: ogportiodll.h =================================================================== RCS file: /cvsroot/opengtoolkit/portIO/c_source/ogportiodll.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ogportiodll.h 3 Mar 2004 13:20:24 -0000 1.1 --- ogportiodll.h 10 Mar 2004 12:42:32 -0000 1.2 *************** *** 22,28 **** */ #if defined(OGPORTIO_EXPORTS) ! #define LibAPI __declspec(dllexport) __cdecl #else ! #define LibAPI __declspec(dllimport) __cdecl #endif --- 22,28 ---- */ #if defined(OGPORTIO_EXPORTS) ! #define LibAPI __declspec(dllexport) __cdecl #else ! #define LibAPI __declspec(dllimport) __cdecl #endif *************** *** 37,42 **** --- 37,47 ---- DWORD LibAPI PortIOEnablePort(unsigned long processID, unsigned short start, unsigned short size); DWORD LibAPI PortIOReleasePort(unsigned long processID, unsigned short start, unsigned short size); + DWORD LibAPI PortIODisableAll(unsigned long processID); DWORD LibAPI PortIOReadDirect(unsigned short address, unsigned long size, void *value); DWORD LibAPI PortIORead(unsigned short address, unsigned long size, void *value); DWORD LibAPI PortIOWriteDirect(unsigned short address, unsigned long size, void *value); DWORD LibAPI PortIOWrite(unsigned short address, unsigned long size, void *value); + + /* Not yet implemented */ + DWORD LibAPI PortIOReadMem(unsigned long address, unsigned long size, char *value); + DWORD LibAPI PortIOWriteMem(unsigned long address, unsigned long size, char *value); |