Use Interlocked* functions in AddRef and Release.
This commit is contained in:
parent
d2512860ac
commit
6a8268f372
|
@ -55,13 +55,13 @@ DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
|||
static ULONG WINAPI
|
||||
DP_and_DPL_AddRef(LPCLASSFACTORY iface) {
|
||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||
return ++(This->ref);
|
||||
return InterlockedIncrement(&This->ref);
|
||||
}
|
||||
|
||||
static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) {
|
||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||
/* static class (reference starts @ 1), won't ever be freed */
|
||||
return --(This->ref);
|
||||
return InterlockedDecrement(&This->ref);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DP_and_DPL_CreateInstance(
|
||||
|
|
|
@ -1516,13 +1516,13 @@ static HRESULT WINAPI MsiCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVO
|
|||
|
||||
static ULONG WINAPI MsiCF_AddRef(LPCLASSFACTORY iface) {
|
||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||
return ++(This->ref);
|
||||
return InterlockedIncrement(&This->ref);
|
||||
}
|
||||
|
||||
static ULONG WINAPI MsiCF_Release(LPCLASSFACTORY iface) {
|
||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||
/* static class, won't be freed */
|
||||
return --(This->ref);
|
||||
return InterlockedDecrement(&This->ref);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI MsiCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
||||
|
|
Loading…
Reference in New Issue