Make both method calls;
1. Consistently written with parameter names as per spec. 2. Fix parameter validation to be consistent with spec. 3. Fix szNameBuf parameter semantics as per spec. 4. Fix szNameBuf casing str search as per spec. 5. Factor out common code into TLB_ helpers vastly improves readability.
-- v29: oleaut32: Fix buffers in MSFT_Do{Funcs,Vars}()
This merge request has too many patches to be relayed via email. Please visit the URL below to see the contents of the merge request. https://gitlab.winehq.org/wine/wine/-/merge_requests/7286
Huw Davies (@huw) commented about dlls/oleaut32/typelib.c:
{ ITypeLibImpl *This = impl_from_ITypeLib2(iface); int tic;
- UINT nNameBufLen = (lstrlenW(szNameBuf)+1)*sizeof(WCHAR), fdc, vrc;
UINT fdc, vrc;
TRACE("%p, %s, %#lx, %p.\n", iface, debugstr_w(szNameBuf), lHashVal, pfName);
*pfName=TRUE; for(tic = 0; tic < This->TypeInfoCount; ++tic){ ITypeInfoImpl *pTInfo = This->typeinfos[tic];
if(!TLB_str_memcmp(szNameBuf, pTInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit;
if(!lstrcmpiW(TLB_get_bstr(pTInfo->Name), szNameBuf)) goto ITypeLib2_fnIsName_exit;
We'd want tests to show that this is case insensitive. Likely we'd want `wcsicmp()` instead of `lstrcmpiW()`.
Huw Davies (@huw) commented about dlls/oleaut32/typelib.c:
ITypeInfoImpl *pTInfo = This->typeinfos[tic]; if(!lstrcmpiW(TLB_get_bstr(pTInfo->Name), szNameBuf)) goto ITypeLib2_fnIsName_exit; for(fdc = 0; fdc < pTInfo->typeattr.cFuncs; ++fdc) {
TLBFuncDesc *pFInfo = &pTInfo->funcdescs[fdc];
TLBFuncDesc *pFDesc = &pTInfo->funcdescs[fdc];
Please avoid these sorts of changes.
This MR is far too long - please restrict them to ~5 commits.
On Wed Feb 19 20:57:34 2025 +0000, Huw Davies wrote:
This MR is far too long - please restrict them to ~5 commits.
A as trivial as possible MR sent here https://gitlab.winehq.org/wine/wine/-/merge_requests/7375 as a ice-breaker for us.
On Wed Feb 19 10:59:04 2025 +0000, Huw Davies wrote:
Please avoid these sorts of changes.
Any particular reason _not_ to have these identifiers consistently named with what they are? Or is that a statement to minimise renaming if at all possible in a general sense, not necessarily this specific patch?