2012-05-05 29 views
0

當我打開WinBase.inl,我看到:這是什麼(未記錄?)調用GetFileAttributesW()?

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"???.???");呢?

回答

2

這是沒有做任何事情。這是一個虛擬調用,其唯一目的是強制將它所在的DLL(Unicows.dll)加載到內存中,以便檢索它的句柄。該參數只是一個無用的Unicode字符串「文件名」,因爲實際值不是必需的,並且如果調用錯誤輸出非法文件名(不允許使用通配符),而不是點擊磁盤只是爲了拋出結果。

+0

Ooooooooooooooh ......如果我知道Unicows.dll是什麼時候會有幫助,它會有幫助。這很有道理,謝謝。 – Mehrdad