Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
827 B

  1. // Copyright (c) 1998 - 1999 Microsoft Corporation
  2. #include "stdafx.h"
  3. #define MemAlloc malloc // for certfy.inc
  4. #define MemFree free
  5. #include "../../tscert/inc/pubblob.h" // needed by certvfy.inc
  6. #include "../../tscert/inc/certvfy.inc" // VerifyFile()
  7. BOOL FileExists (char *pszFullNameAndPath); // from tstst.cpp
  8. BOOL CheckifBinaryisSigned(TCHAR *szFile)
  9. {
  10. USES_CONVERSION;
  11. TCHAR szFullFile[MAX_PATH +1];
  12. RTL_CRITICAL_SECTION VfyLock;
  13. if (ExpandEnvironmentStrings(szFile, szFullFile, MAX_PATH))
  14. {
  15. if (FileExists(T2A(szFullFile)))
  16. {
  17. RtlInitializeCriticalSection( &VfyLock );
  18. if ( VerifyFile( T2W(szFullFile), &VfyLock ) )
  19. {
  20. return TRUE;
  21. }
  22. }
  23. }
  24. return FALSE;
  25. }