IT-Consultant: José Roca (PBWIN 10+/PBCC 6+) (Archive only) > Windows API Headers

CM_Locate_DevNode(Ex)

(1/1)

Pierre Bellisle:
Salut Jose,

I was playing with CM_Locate_DevNode(Ex).
For some, life could be easier if the pdnDevInst DWORD parameter was declared as BYREF.

This applies for the four implementations of the function.
CM_Locate_DevNodeA()
CM_Locate_DevNodeW()
CM_Locate_DevNode_ExA()
CM_Locate_DevNode_ExW()

Hasta luego.

José Roca:
The "A" versions are correctly declared as BYREF ASCIIZ. The "W" versions should be BYREF WSTRINGZ. I declared them as BYVAL DWORD because I wrote it for PB9, that had no implemented this data type and then forgot to change it for PB10.

Attached is the modified file. I have changed CM_Create_DevNodeW, CM_Create_DevNode_ExW, CM_Get_HW_Prof_FlagsW, CM_Get_HW_Prof_Flags_ExW, CM_Get_Device_Interface_ListW, CM_Get_Device_Interface_List_ExW, CM_Get_Device_Interface_List_SizeW, CM_Get_Device_Interface_List_Size_ExW, CM_Locate_DevNodeW, CM_Locate_DevNode_ExW, CM_Set_HW_Prof_FlagsW and CM_Set_HW_Prof_Flags_ExW.

Pierre Bellisle:
Hola Jose,

Thank for the update.
I guess I could have elaborate my thought a little bit more.
I was referring only to the pdnDevInst variable part.
pdnDevInst will be written to by the CM_Locate_DevNode(Ex)(AW) functions.


--- Code: ---LOCAL crError    AS DWORD
LOCAL pdnDevInst AS DWORD

crError = CM_Locate_DevNode(BYVAL pdnDevInst, BYVAL %NULL, %CM_Locate_Devnode_Normal) 'crError = %CR_INVALID_POINTER 0x3

crError = CM_Locate_DevNode(BYREF pdnDevInst, BYVAL %NULL, %CM_Locate_Devnode_Normal) 'crError = %CR_SUCCESS 0x0

--- End code ---

José Roca:
Ok. File updated.

Pierre Bellisle:
:-)

Navigation

[0] Message Index

Go to full version