Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- g++ -o testPorts.exe testPorts.cpp -lsetupapi -mwindows
- #include (Left Carat)windows.h>
- #include (Left Carat)initguid.h>
- #include (Left Carat)devguid.h>
- #include (Left Carat)setupapi.h>
- #include (Left Carat)stdio.h>
- int main() {
- SP_DEVINFO_DATA devInfoData = {};
- devInfoData.cbSize = sizeof(devInfoData);
- // Get port info tree:
- HDEVINFO hDeviceInfo = SetupDiGetClassDevs( &GUID_DEVCLASS_PORTS,
- 0,
- NULL,
- DIGCF_PRESENT
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement