User:Behnam8419/sandbox

BOOL InitWinTrustApi {	if (bWinTrustInited) return bWinTrustInitSuccess; bWinTrustInited = TRUE; if (!hWinTrust) hWinTrust = LoadLibrary("wintrust.dll"); if (!hWinTrust) return FALSE; fWinVerifyTrust = (tWinVerifyTrust)GetProcAddress(hWinTrust, "WinVerifyTrust"); if (!fWinVerifyTrust) return FALSE; fWTHelperGetProvSignerFromChain = (tWTHelperGetProvSignerFromChain)GetProcAddress(hWinTrust, "WTHelperGetProvSignerFromChain"); if (!fWTHelperGetProvSignerFromChain) return FALSE; fWTHelperProvDataFromStateData = (tWTHelperProvDataFromStateData)GetProcAddress(hWinTrust, "WTHelperProvDataFromStateData"); if (!fWTHelperProvDataFromStateData) return FALSE; if (!hCrypt32) hCrypt32 = LoadLibrary("crypt32.dll"); if (!hCrypt32) return FALSE; fCertNameToStrW = (tCertNameToStrW)GetProcAddress(hCrypt32, "CertNameToStrW"); if (!fCertNameToStrW) return FALSE; fCertGetNameStringW = (tCertGetNameStringW)GetProcAddress(hCrypt32, "CertGetNameStringW"); if (!fCertGetNameStringW) return FALSE; bWinTrustInitSuccess = TRUE; return TRUE; }