Programming style...



originated in the java corner, i have some difficulties to adapt the
programming style used in the platform sdk and the ddk. therefore i'd like to
know what you think about the way i handled some things.

1) device interface GUIDs not defined in a global header:
i tried to find the GUID of disc type devices which are part of the mass
storage device group. because i didn't find any, i looked up the GUID value
stored in my registry and defined it in my app. is this a bad habit or can i
assume that this GUID never changes in further versions of ms win?

2) error checking:
SetupDiGetClassDevs and many other functions return a specific value if they
fail. so should i check for failure although such case is impossible? e.g.
SetupDiGetClassDevs with GUID_DEVINTERFACE_VOLUME should never fail. i ask
because useless failure checks make the code unreadable.
.



Relevant Pages

  • Re: Programming style...
    ... >> SetupDiGetClassDevs and many other functions return a specific value if they ... >> fail. ... >> because useless failure checks make the code unreadable. ... Prev by Date: ...
    (microsoft.public.development.device.drivers)
  • Re: Programming style...
    ... SetupDiGetClassDevs and many other functions return a specific value if they fail. ... i ask because useless failure checks make the code unreadable. ... A clean if else style and a proper indentation solves that. ...
    (microsoft.public.development.device.drivers)
  • RE: 2 device interface questions
    ... Interface GUID. ... you need to specify DIGCF_DEVICEINTERFACE so that an Interface Class GUID ... then SetupDiGetClassDevs will treat your Interface ...
    (microsoft.public.development.device.drivers)
  • Re: How to use CreateFile to talk to a usb driver?
    ... Now,I may enumerate all devices installed on my machine,thus means that the ... SetupDiGetClassDevs & SetupDiEnumDeviceInfo calls works well. ... The most confusing part is the InterfaceClassGuid.Is that the Guid of the ... >> Somebody told me that CreateFile() may do the work. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: How to use CreateFile to talk to a usb driver?
    ... Now,I may enumerate all devices installed on my machine,thus means that the ... SetupDiGetClassDevs & SetupDiEnumDeviceInfo calls works well. ... The most confusing part is the InterfaceClassGuid.Is that the Guid of the ... Somebody told me that CreateFile() may do the work. ...
    (microsoft.public.win32.programmer.kernel)