The MASM Forum

Miscellaneous => The Orphanage => Topic started by: jj2007 on February 29, 2024, 10:10:37 PM

Title: How does C++ pass a CLSID?
Post by: jj2007 on February 29, 2024, 10:10:37 PM
Question: Does the "REF" mean a pointer is passed, or are 16 bytes shuffled into the stack?

MS Learn (https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-dllgetclassobject):
HRESULT DllGetClassObject(
  [in]  REFCLSID rclsid,
  [in]  REFIID   riid,
  [out] LPVOID   *ppv
QuoteParameters
[in] rclsid

The CLSID that will associate the correct data and code.

[in] riid

A reference to the identifier of the interface that the caller is to use to communicate with the class object. Usually, this is IID_IClassFactory (defined in the OLE headers as the interface identifier for IClassFactory).
Title: Re: How does C++ pass a CLSID?
Post by: TimoVJL on February 29, 2024, 10:36:03 PM
pointers they are.
guiddef.h
#ifndef _REFGUID_DEFINED
#define _REFGUID_DEFINED
#ifdef __cplusplus
#define REFGUID const GUID &
#else
#define REFGUID const GUID * __MIDL_CONST
#endif
#endif

#ifndef _REFIID_DEFINED
#define _REFIID_DEFINED
#ifdef __cplusplus
#define REFIID const IID &
#else
#define REFIID const IID * __MIDL_CONST
#endif
#endif

#ifndef _REFCLSID_DEFINED
#define _REFCLSID_DEFINED
#ifdef __cplusplus
#define REFCLSID const IID &
#else
#define REFCLSID const IID * __MIDL_CONST
#endif
#endif