添加 RoInitialize、RoUninitialize以及一些WinRT参数返回值修正(https://github.com/Chuyu-Team/YY-Thunks/issues/28)

This commit is contained in:
mingkuang
2021-06-30 13:01:23 +08:00
parent d6d5f4d4ca
commit 7fc89b9c5e
3 changed files with 37 additions and 1 deletions
+3
View File
@@ -222,3 +222,6 @@
| [FlsFree](https://docs.microsoft.com/windows/win32/api/fibersapi/nf-fibersapi-flsfree) | 不存在时,使用Tls实现。警告,此函数请勿跨模块使用!!!
| [FlsGetValue](https://docs.microsoft.com/windows/win32/api/fibersapi/nf-fibersapi-flsgetvalue) | 不存在时,使用Tls实现。警告,此函数请勿跨模块使用!!!
| [FlsSetValue](https://docs.microsoft.com/windows/win32/api/fibersapi/nf-fibersapi-flssetvalue) | 不存在时,使用Tls实现。警告,此函数请勿跨模块使用!!!
| [RoInitialize](https://docs.microsoft.com/windows/win32/api/roapi/nf-roapi-roinitialize) | 不存在时,调用 CoInitializeEx。
| [RoUninitialize](https://docs.microsoft.com/windows/win32/api/roapi/nf-roapi-rouninitialize) | 不存在时,调用 CoUninitialize。
@@ -25,6 +25,9 @@ namespace YY
return pWindowsCreateString(sourceString, length, string);
}
if (string)
*string = nullptr;
return E_NOTIMPL;
}
#endif
@@ -51,6 +54,9 @@ namespace YY
return pWindowsCreateStringReference(sourceString, length, hstringHeader, string);
}
if (string)
*string = nullptr;
return E_NOTIMPL;
}
#endif
@@ -98,6 +104,10 @@ namespace YY
return pWindowsDuplicateString(string, newString);
}
if (newString)
*newString = nullptr;
return E_NOTIMPL;
}
#endif
@@ -145,6 +155,9 @@ namespace YY
return pWindowsGetStringRawBuffer(string, length);
}
if (length)
*length = 0;
return nullptr;
}
#endif
+21 -1
View File
@@ -24,7 +24,12 @@ namespace YY
return pRoInitialize(initType);
}
return E_NOTIMPL;
if ((unsigned)initType > (unsigned)RO_INIT_MULTITHREADED)
{
return E_INVALIDARG;
}
return CoInitializeEx(nullptr, initType ? COINIT_MULTITHREADED : COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
}
#endif
@@ -44,6 +49,8 @@ namespace YY
{
return pRoUninitialize();
}
CoUninitialize();
}
#endif
@@ -66,6 +73,9 @@ namespace YY
return pRoActivateInstance(activatableClassId, instance);
}
if (instance)
*instance = nullptr;
return E_NOTIMPL;
}
#endif
@@ -91,6 +101,9 @@ namespace YY
return pRoRegisterActivationFactories(activatableClassIds, activationFactoryCallbacks, count, cookie);
}
if (cookie)
*cookie = nullptr;
return E_NOTIMPL;
}
#endif
@@ -136,6 +149,9 @@ namespace YY
return pRoGetActivationFactory(activatableClassId, iid, factory);
}
if (factory)
*factory = nullptr;
return E_NOTIMPL;
}
@@ -162,6 +178,10 @@ namespace YY
return pRoRegisterForApartmentShutdown(callbackObject, apartmentIdentifier, regCookie);
}
if (regCookie)
*regCookie = nullptr;
return E_NOTIMPL;
}