I have programmed COM functions for many years, and today I noticed that many functions in fact have different signatures in C and C++. For example CoCreateInstance function:
HRESULT CoCreateInstance(
_In_ REFCLSID rclsid,
_In_ LPUNKNOWN pUnkOuter,
_In_ DWORD dwClsContext,
_In_ REFIID riid,
_Out_ LPVOID *ppv
);
In C++, the signature expands to
unsigned __int32 CoCreateInstance(const CLSID& clsid, IUnknown*
pUnkOuter, unsigned __int32 dwClsContext, const IID& iid, void* ppv);
While in C, the signature becomes
unsigned __int32 CoCreateInstance(const CLSID* clsid, IUnknown*
pUnkOuter, unsigned __int32 dwClsContext, const IID* iid, void* ppv);
In Ole32.dll there is only one entry for CoCreateInstance, which means that the two declarations point to the same implementation.
Is this Microsoft extension or supported by C++ standard?