#include #include "debug.h" #include "stringutils.h" #include "args.h" #include "kernelmisc.h" #include "devicedriverloader.h" // prun tstdev Drivers\builtin\flashdrv int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { TCHAR *drvkey= lpCmdLine; KernelMode _km; DebugSetLogfile("tstdev.log"); devicedriverloader drv; if (!drv.load(drvkey)) return 1; DWORD dwHandle= drv.open(0, 0); debugt("open: handle=%08lx stat=%08lx\n", dwHandle, GetLastError()); BYTE buf[16]; DWORD nRet = drv.DrvRead(dwHandle, buf, 16); debug("read: %08lx, stat=%08lx\n", nRet, GetLastError()); // DWORD nWrit= DrvWrite(dwHandle, buf, 16); // debug("write: %08lx, stat=%08lx\n", nWrit, GetLastError()); BOOL clres= drv.DrvClose(dwHandle); debugt("close: res=%08lx stat=%08lx\n", clres, GetLastError()); return 0; }