App부분..
#include <windows.h> #include <initguid.h> DEFINE_GUID(SampleGuid, 0x5665dec0, 0xa40a, 0x11d1, 0xb9, 0x84, 0x0, 0x20, 0xaf, 0xd7, 0x97, 0x78); #define MAXDEVICENUMBER 10 if( Info == (HANDLE) -1 ) SetupDiGetDeviceInterfaceDetail( Info, &interfaceData, 0, 0, &size, 0 ); // CreateFile을 할 수 있는 이름이 구해지는 부분 SetupDiDestroyDeviceInfoList( Info ); int count; return 0;
|
드라이버 부분
DEFINE_GUID(GUID_SAMPLE, 0x5665dec0, 0xa40a, 0x11d1, 0xb9, 0x84, 0x0, 0x20, 0xaf, 0xd7, 0x97, 0x78); Addevice나 Entry시.. IoRegisterDeviceInterface( phyDeviceObject, &GUID_SAMPLE, NULL, &dex->UnicodeString ); Remove나 Unload시.. IoSetDeviceInterfaceState( &dex->UnicodeString, FALSE ); RtlFreeUnicodeString( &dex->UnicodeString ); |