0

当我打开WinBase.inl时,我看到:

ISOLATION_AWARE_INLINE FARPROC IsolationAwarePrivatenCv
IsolationAwarePrivatezltRgCebPnQQeRff(
    __in IsolationAwarePrivateCpBAFGnAG_zBqHyr_vAsB c,
    __inout IsolationAwarePrivateCzHGnoyr_zBqHyr_vAsB m,
    __in PCSTR ProcName
    )
{
    FARPROC Proc = NULL;
    HMODULE hModule;
#ifdef _M_IX86
    static HMODULE s_moduleUnicows;
    static BOOL s_fUnicowsInitialized;

    /*
       get unicows.dll loaded on-demand
    */
    if (!s_fUnicowsInitialized)
    {
    if ((GetVersion() & 0x80000000) != 0)
    {
        GetFileAttributesW(L"???.???");
        s_moduleUnicows = GetModuleHandleA("Unicows.dll");
    }
    s_fUnicowsInitialized = TRUE;
    }

    /*
       always call GetProcAddress(unicows) before the usual .dll
    */
    if (s_moduleUnicows != NULL)
    {
    Proc = GetProcAddress(s_moduleUnicows, ProcName);
    if (Proc != NULL)
        goto Exit;
    }
#endif
    hModule = m->WinbaseIsolationAwarePrivateybNQRQzbQhYR;
    if (hModule == NULL)
    {
#ifdef _M_IX86
    hModule = (((GetVersion() & 0x80000000) != 0) ? (*c->WinbaseIsolationAwarePrivateybNQn)(c->WinbaseIsolationAwarePrivateANZRn) : (*c->WinbaseIsolationAwarePrivateybNQJ)(c->WinbaseIsolationAwarePrivateANZRJ));
#else
    hModule = (*c->WinbaseIsolationAwarePrivateybNQJ)(c->WinbaseIsolationAwarePrivateANZRJ);
#endif
    if (hModule == NULL)
        goto Exit;
    m->WinbaseIsolationAwarePrivateybNQRQzbQhYR = hModule;
    }
    Proc = GetProcAddress(hModule, ProcName);
Exit:
    return Proc;
}

有谁知道是GetFileAttributesW(L"???.???");做什么的?

4

1 回答 1

2

这有点像什么都不做。这是一个虚拟调用,其唯一目的是强制将其所在的 DLL ( Unicows.dll) 加载到内存中,以便可以检索其句柄。该参数只是一个无用的 Unicode 字符串“文件名”,因为不需要实际值,并且如果调用在非法文件名(不允许通配符)上出错,而​​不是仅仅为了抛出结果而敲击磁盘,它会更快一些.

于 2012-05-05T01:19:20.920 回答