WindowsXP-SP1/termsrv/setup/tstst/tscert.cpp

37 lines
827 B
C++
Raw Permalink Normal View History

2001-01-01 00:00:00 +01:00
// Copyright (c) 1998 - 1999 Microsoft Corporation
#include "stdafx.h"
#define MemAlloc malloc // for certfy.inc
#define MemFree free
#include "../../tscert/inc/pubblob.h" // needed by certvfy.inc
#include "../../tscert/inc/certvfy.inc" // VerifyFile()
BOOL FileExists (char *pszFullNameAndPath); // from tstst.cpp
BOOL CheckifBinaryisSigned(TCHAR *szFile)
{
USES_CONVERSION;
TCHAR szFullFile[MAX_PATH +1];
RTL_CRITICAL_SECTION VfyLock;
if (ExpandEnvironmentStrings(szFile, szFullFile, MAX_PATH))
{
if (FileExists(T2A(szFullFile)))
{
RtlInitializeCriticalSection( &VfyLock );
if ( VerifyFile( T2W(szFullFile), &VfyLock ) )
{
return TRUE;
}
}
}
return FALSE;
}