summaryrefslogtreecommitdiff
path: root/unittests/autotestscripts/check_debug_dlls.pl
blob: 7f1e16c29aafecc55b153b9dcde9419fbc9c3f70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!perl

use File::Find;
use Win32::API;

find(\&ProcessFile, "../../../game/bin/" );

sub ProcessFile
  {
	return if (/360/);
	return unless( /\.dll$/i );
	my $LoadLibrary = Win32::API->new( "kernel32", "LoadLibrary","P","L" );
	my $GetProcAddress = Win32::API->new( "kernel32", "GetProcAddress","LP","L" );
	my $FreeLibrary = Win32::API->new( "kernel32", "FreeLibrary", "P", "V" );
	my $handle=$LoadLibrary->Call($_);
	if ( $handle )
	  {
		my $proc = $GetProcAddress->Call($handle, "BuiltDebug\0");
		if ( $proc )
		  {
			print "Error $_ is built debug\n";
		  }
		$FreeLibrary->Call( $handle );
	  }
  }