88
99from .pfwtest import *
1010
11+
12+
1113@check_for_gc_garbage
1214class TestNativeUtils (object ):
13- @process_64bit_only
15+ @process_architecture_only ( gdef . IMAGE_FILE_MACHINE_AMD64 )
1416 def test_strlenw64 (self ):
1517 strlenw64 = windows .native_exec .create_function (nativeutils .StrlenW64 .get_code (), [gdef .UINT , gdef .LPCWSTR ])
1618 assert strlenw64 ("YOLO" ) == 4
1719 assert strlenw64 ("" ) == 0
1820
19- @process_64bit_only
21+ @process_architecture_only ( gdef . IMAGE_FILE_MACHINE_AMD64 )
2022 def test_strlena64 (self ):
2123 strlena64 = windows .native_exec .create_function (nativeutils .StrlenA64 .get_code (), [gdef .UINT , gdef .LPCSTR ])
2224 assert strlena64 (b"YOLO" ) == 4
2325 assert strlena64 (b"" ) == 0
2426
25- @process_64bit_only
27+ @process_architecture_only ( gdef . IMAGE_FILE_MACHINE_AMD64 )
2628 def test_getprocaddr64 (self ):
2729 getprocaddr64 = windows .native_exec .create_function (nativeutils .GetProcAddress64 .get_code (), [gdef .ULONG64 , gdef .LPCWSTR , gdef .LPCSTR ])
2830 k32 = [mod for mod in windows .current_process .peb .modules if mod .name == "kernel32.dll" ][0 ]
@@ -37,19 +39,19 @@ def test_getprocaddr64(self):
3739 assert getprocaddr64 ("YOLO.DLL" , b"whatever" ) == 0xfffffffffffffffe
3840 assert getprocaddr64 ("KERNEL32.DLL" , b"YOLOAPI" ) == 0xffffffffffffffff
3941
40- @process_32bit_only
42+ @process_architecture_only ( gdef . IMAGE_FILE_MACHINE_I386 )
4143 def test_strlenw32 (self ):
4244 strlenw32 = windows .native_exec .create_function (nativeutils .StrlenW32 .get_code (), [gdef .UINT , gdef .LPCWSTR ])
4345 assert strlenw32 ("YOLO" ) == 4
4446 assert strlenw32 ("" ) == 0
4547
46- @process_32bit_only
48+ @process_architecture_only ( gdef . IMAGE_FILE_MACHINE_I386 )
4749 def test_strlena32 (self ):
4850 strlena32 = windows .native_exec .create_function (nativeutils .StrlenA32 .get_code (), [gdef .UINT , gdef .LPCSTR ])
4951 assert strlena32 (b"YOLO" ) == 4
5052 assert strlena32 (b"" ) == 0
5153
52- @process_32bit_only
54+ @process_architecture_only ( gdef . IMAGE_FILE_MACHINE_I386 )
5355 def test_getprocaddr32 (self ):
5456 getprocaddr32 = windows .native_exec .create_function (nativeutils .GetProcAddress32 .get_code (), [gdef .UINT , gdef .LPCWSTR , gdef .LPCSTR ])
5557 k32 = [mod for mod in windows .current_process .peb .modules if mod .name == "kernel32.dll" ][0 ]
0 commit comments