Click here to Skip to main content
15,886,362 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
GeneralRe: is there anyone who using visualDDK? Pin
Dave Kreskowiak30-Jul-09 2:08
mveDave Kreskowiak30-Jul-09 2:08 
GeneralRe: is there anyone who using visualDDK? Pin
Luc Pattyn30-Jul-09 2:14
sitebuilderLuc Pattyn30-Jul-09 2:14 
QuestionWindows Mobile Device with Webcams Plugged In Pin
henry00023-Jul-09 15:00
henry00023-Jul-09 15:00 
QuestionCustom Device Driver / Editing Device Driver Pin
Soundshark20-Jul-09 4:34
Soundshark20-Jul-09 4:34 
AnswerRe: Custom Device Driver / Editing Device Driver Pin
Luc Pattyn20-Jul-09 6:20
sitebuilderLuc Pattyn20-Jul-09 6:20 
GeneralRe: Custom Device Driver / Editing Device Driver Pin
Soundshark20-Jul-09 6:27
Soundshark20-Jul-09 6:27 
QuestionServer Imaging Pin
asldrthweon16-Jul-09 5:21
asldrthweon16-Jul-09 5:21 
Questioncan you tell me blow source? Pin
buffering8312-Jul-09 5:55
buffering8312-Jul-09 5:55 
i am student who study device driver.
i don't understand blow source so i search DDK document but i can't understand.

can you explain line by line?

sorry to ask whole thing

HANDLE GetDeviceViaInterface( GUID* pGuid, DWORD instance)
{
// Get handle to relevant device information set
HDEVINFO info = SetupDiGetClassDevs(pGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_INTERFACEDEVICE);
if(info==INVALID_HANDLE_VALUE)
{
printf("No HDEVINFO available for this GUID\n");
return NULL;
}

// Get interface data for the requested instance
SP_INTERFACE_DEVICE_DATA ifdata;
ifdata.cbSize = sizeof(ifdata);
if(!SetupDiEnumDeviceInterfaces(info, NULL, pGuid, instance, ifdata))
{
printf("No SP_INTERFACE_DEVICE_DATA available for this GUID instance\n");
SetupDiDestroyDeviceInfoList(info);
return NULL;
}

// Get size of symbolic link name
DWORD ReqLen;
SetupDiGetDeviceInterfaceDetail(info, ifdata, NULL, 0, ReqLen, NULL);
PSP_INTERFACE_DEVICE_DETAIL_DATA ifDetail = (PSP_INTERFACE_DEVICE_DETAIL_DATA)(new char[ReqLen]);
if( ifDetail==NULL)
{
SetupDiDestroyDeviceInfoList(info);
return NULL;
}

// Get symbolic link name
ifDetail->cbSize = sizeof(SP_INTERFACE_DEVICE_DETAIL_DATA);
if( !SetupDiGetDeviceInterfaceDetail(info, ifdata, ifDetail, ReqLen, NULL, NULL))
{
SetupDiDestroyDeviceInfoList(info);
delete ifDetail;
return NULL;
}

printf("Symbolic link is %s\n",ifDetail;DevicePath);
// Open file
HANDLE rv = CreateFile( ifDetail;DevicePath,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if( rv==INVALID_HANDLE_VALUE) rv = NULL;

delete ifDetail;
SetupDiDestroyDeviceInfoList(info);
return rv;
}

hi
i am student.
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~

QuestionMachine Language Resources Pin
Alien FX Fiend™4-Jul-09 7:05
Alien FX Fiend™4-Jul-09 7:05 
AnswerRe: Machine Language Resources Pin
Luc Pattyn4-Jul-09 7:24
sitebuilderLuc Pattyn4-Jul-09 7:24 
AnswerRe: Machine Language Resources Pin
Adam Roderick J6-Jul-09 6:04
Adam Roderick J6-Jul-09 6:04 
QuestionNetwork Interface Card Pin
Gjm3-Jul-09 5:51
Gjm3-Jul-09 5:51 
AnswerRe: Network Interface Card Pin
User 17164923-Jul-09 6:14
professionalUser 17164923-Jul-09 6:14 
QuestionUnregistering USB device types Pin
supercat930-Jun-09 8:14
supercat930-Jun-09 8:14 
AnswerRe: Unregistering USB device types Pin
Sebastian Schneider9-Jul-09 2:36
Sebastian Schneider9-Jul-09 2:36 
GeneralRe: Unregistering USB device types Pin
supercat99-Jul-09 4:24
supercat99-Jul-09 4:24 
Question3.5" Floppy to USB conversion hardware Pin
cvogt6145730-Jun-09 7:24
cvogt6145730-Jun-09 7:24 
AnswerRe: 3.5" Floppy to USB conversion hardware Pin
supercat930-Jun-09 9:30
supercat930-Jun-09 9:30 
GeneralRe: 3.5" Floppy to USB conversion hardware Pin
cvogt6145730-Jun-09 11:13
cvogt6145730-Jun-09 11:13 
GeneralRe: 3.5" Floppy to USB conversion hardware Pin
supercat930-Jun-09 13:13
supercat930-Jun-09 13:13 
GeneralRe: 3.5" Floppy to USB conversion hardware Pin
Dan Neely1-Jul-09 2:16
Dan Neely1-Jul-09 2:16 
GeneralRe: 3.5" Floppy to USB conversion hardware Pin
cvogt614571-Jul-09 3:44
cvogt614571-Jul-09 3:44 
AnswerRe: 3.5" Floppy to USB conversion hardware Pin
SleepRequired4-Jul-09 14:07
SleepRequired4-Jul-09 14:07 
AnswerRe: 3.5" Floppy to USB conversion hardware Pin
kwalityenterprises27-Nov-10 2:32
kwalityenterprises27-Nov-10 2:32 
QuestionServer hardware for a startup Pin
raicuandi22-Jun-09 21:48
raicuandi22-Jun-09 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.