The macro DEFINE_GUID Is missing or renamed ?

Windows specific questions.
D.J.Peters
Posts: 7838
Joined: May 28, 2005 3:28

The macro DEFINE_GUID Is missing or renamed ?

Postby D.J.Peters » Sep 30, 2019 19:31

If I recompile my older USB enumeration code I get DEFINE_GUIDE isn't defined !

Is it renamed or removed ?
I searched with the help of geny in all windows include files but without success.

Joshy

Code: Select all

#define WIN_INCLUDEALL
#include once "windows.bi"
#include once "win/winioctl.bi"
#include once "win/setupapi.bi"

DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE,&HA5DCBF10,&H6530,&H11D2,&H90,&H1F,&H00,&HC0,&H4F,&HB9,&H51,&HED)

'
' main
'
dim as HDEVINFO hInfo = SetupDiGetClassDevs(@GUID_DEVINTERFACE_USB_DEVICE, NULL, 0, DIGCF_DEVICEINTERFACE or DIGCF_PRESENT)
if hInfo<>INVALID_HANDLE_VALUE then
  dim as SP_DEVICE_INTERFACE_DATA InterfaceData
  dim as DWORD dwIndex=0
  InterfaceData.cbSize=sizeof(SP_DEVICE_INTERFACE_DATA)
  while SetupDiEnumDeviceInterfaces(hInfo, NULL, @GUID_DEVINTERFACE_USB_DEVICE,dwIndex, @InterfaceData)<>FALSE
    dim as SP_DEVINFO_DATA InfoData
    InfoData.cbSize=sizeof(SP_DEVINFO_DATA)
    dim as DWORD dwSize
    SetupDiGetDeviceInterfaceDetail(hInfo, @InterfaceData, NULL, 0, @dwSize, NULL)
    dim as PSP_DEVICE_INTERFACE_DETAIL_DATA pDetailData=callocate(dwSize)
    ' pDetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA)
    pDetailData->cbSize = 5
    if SetupDiGetDeviceInterfaceDetail(hInfo, @InterfaceData,pDetailData, dwSize, @dwSize, @InfoData)<>FALSE then
      print "devicepath[" & dwIndex & "] " &  *cptr(zstring ptr,@pDetailData->DevicePath)
    end if
    deallocate pDetailData : pDetailData=NULL
    dwIndex+=1
  wend
  SetupDiDestroyDeviceInfoList(hInfo)
end if
sleep
You can see other windows include files use it also:
file "vfw.bi"

Code: Select all

#define DEFINE_AVIGUID(name, l, w1, w2) DEFINE_GUID(name, l, w1, w2, &hC0, 0, 0, 0, 0, 0, 0, &h46)

file "windot11,bi"

Code: Select all

#define DEFINE_NWF_GUID(NAME, ORD) DEFINE_GUID(NAME, &h6cb9a43e + (ORD), &hc45f, &h4039, &h9f, &he6, &hd0, &h8c, &hb0, &h57, &h18, &h4c)
badidea
Posts: 1584
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: The macro DEFINE_GUID Is missing or renamed ?

Postby badidea » Sep 30, 2019 19:53

A search on the forum directed me to this lonely post from 2012: viewtopic.php?f=6&t=19519&p=171220&hilit=DEFINE_GUID#p171220
D.J.Peters
Posts: 7838
Joined: May 28, 2005 3:28

Re: The macro DEFINE_GUID Is missing or renamed ?

Postby D.J.Peters » Sep 30, 2019 20:15

Thank you I know how to define a GUID but looks like since any update the include files changed !

Joshy
badidea
Posts: 1584
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: The macro DEFINE_GUID Is missing or renamed ?

Postby badidea » Sep 30, 2019 21:35

Some more searching on GitHub:

It was added in 0.90.0: https://github.com/freebasic/fbc/commit ... e9526549a3

And removed in 1.02.0: https://github.com/freebasic/fbc/commit ... e9526549a3

Or actually replaced by guiddef.bi: https://github.com/freebasic/fbc/commit ... 3a283e2920 (but that code it to cryptic for me)
D.J.Peters
Posts: 7838
Joined: May 28, 2005 3:28

Re: The macro DEFINE_GUID Is missing or renamed ?

Postby D.J.Peters » Oct 01, 2019 1:51

@badidea again thank you

Joshy

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 2 guests