34#define ok_aw(aString, wString) \
35 WideCharToMultiByte(CP_ACP, 0, wString, -1, string1, MAX_PATH, NULL, NULL); \
36 if (lstrcmpA(string1, aString) != 0) \
37 ok(0, "Expected \"%s\", got \"%s\"\n", aString, string1);
56 if (!pLoadLibraryShim)
62 hr = pLoadLibraryShim(
L"fusion.dll",
NULL,
NULL, &hfusion);
66 pCreateAssemblyNameObject = (
void *)
GetProcAddress(hfusion,
"CreateAssemblyNameObject");
67 if (!pCreateAssemblyNameObject)
307 {
S_OK,
"\x01\x23\x45\x67\x89\x0a\xbc\xde", 8},
349 for (
i = 0;
i < ASM_NAME_MAX_PARAMS;
i++)
360 "%d: prop %ld: Expected %08lx, got %08lx\n",
line,
i, vals[
i].
hr,
hr);
366 ok(
str[0] == 0xcccc,
"%d: prop %ld: str[0] = %x\n",
line,
i,
str[0]);
370 if (
i != ASM_NAME_NAME &&
i != ASM_NAME_CULTURE)
382 "%d: prop %ld: Expected STRSAFE_E_INSUFFICIENT_BUFFER, got %08lx\n",
line,
i,
hr);
389#define test_assembly_name_props(name, vals) \
390 test_assembly_name_props_line(name, vals, __LINE__);
403 hr = pCreateAssemblyNameObject(
NULL, namestr, 0,
NULL);
423 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
427 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
430 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
436 ok(
str[0] ==
'a',
"got %c\n",
str[0]);
441 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
444 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
445 ok(hi == 0,
"Expected 0, got %08lx\n", hi);
446 ok(lo == 0,
"Expected 0, got %08lx\n", lo);
449 win_skip(
".NET 1.x doesn't handle ASM_NAME_PROCESSOR_ID_ARRAY"
450 " and ASM_NAME_OSINFO_ARRAY correctly\n");
454 IAssemblyName_Release(
name);
459 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
463 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
466 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
491 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
492 ok(!
str[0],
"Expected empty name\n");
497 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
500 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
501 ok(hi == 0,
"Expected 0, got %08lx\n", hi);
502 ok(lo == 0,
"Expected 0, got %08lx\n", lo);
505 win_skip(
".NET 1.x doesn't handle ASM_NAME_PROCESSOR_ID_ARRAY"
506 " and ASM_NAME_OSINFO_ARRAY correctly\n");
510 IAssemblyName_Release(
name);
516 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
533 ok(
str[0] ==
'a',
"got %c\n",
str[0]);
538 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
540 ok(
str[0] ==
'a',
"got %c\n",
str[0]);
544 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
545 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
559 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
565 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
568 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
569 ok(hi == 0,
"Expected 0, got %08lx\n", hi);
570 ok(lo == 0,
"Expected 0, got %08lx\n", lo);
573 win_skip(
".NET 1.x doesn't handle ASM_NAME_PROCESSOR_ID_ARRAY"
574 " and ASM_NAME_OSINFO_ARRAY correctly\n");
578 IAssemblyName_Release(
name);
586 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
590 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
591 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
598 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
604 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
607 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
608 ok(hi == 0,
"Expected 0, got %08lx\n", hi);
609 ok(lo == 0,
"Expected 0, got %08lx\n", lo);
613 IAssemblyName_Release(
name);
619 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
623 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
624 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
625 ok_aw(
"wine, Version=1.2.3.4",
str);
626 ok(
size == 22,
"Expected 22, got %ld\n",
size);
631 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
637 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
638 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
639 ok(hi == 0x00010002,
"Expected 0x00010002, got %08lx\n", hi);
640 ok(lo == 0x00030004,
"Expected 0x00030004, got %08lx\n", lo);
644 IAssemblyName_Release(
name);
650 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
654 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
655 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
657 ok(
size == 18,
"Expected 18, got %ld\n",
size);
662 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
668 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
671 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
674 "Expected 0, got %08lx\n", hi);
675 ok(lo == 0,
"Expected 0, got %08lx\n", lo);
679 IAssemblyName_Release(
name);
685 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
689 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
690 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
691 ok_aw(
"wine, Culture=neutral",
str);
692 ok(
size == 22,
"Expected 22, got %ld\n",
size);
697 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
703 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
706 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
707 ok(hi == 0,
"Expected 0, got %08lx\n", hi);
708 ok(lo == 0,
"Expected 0, got %08lx\n", lo);
712 IAssemblyName_Release(
name);
718 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
722 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
723 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
725 ok(
size == 17,
"Expected 17, got %ld\n",
size);
730 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
736 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
739 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
740 ok(hi == 0,
"Expected 0, got %08lx\n", hi);
741 ok(lo == 0,
"Expected 0, got %08lx\n", lo);
745 IAssemblyName_Release(
name);
748 to_widechar(namestr,
"wine, PublicKeyToken=01234567890abcde");
751 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
755 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
756 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
757 ok_aw(
"wine, PublicKeyToken=01234567890abcde",
str);
758 ok(
size == 38,
"Expected 38, got %ld\n",
size);
763 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
769 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
772 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
773 ok(hi == 0,
"Expected 0, got %08lx\n", hi);
774 ok(lo == 0,
"Expected 0, got %08lx\n", lo);
778 IAssemblyName_Release(
name);
781 to_widechar(namestr,
"wine, processorArchitecture=x86");
784 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
789 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_PROCESSORARCHITECTURE);
790 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
795 win_skip(
"processorArchitecture not supported on .NET 1.x\n");
798 ok_aw(
"wine, processorArchitecture=x86",
str);
799 ok(
size == 32,
"Expected 32, got %ld\n",
size);
802 hr = IAssemblyName_GetProperty(
name, ASM_NAME_ARCHITECTURE, &arch, &
size);
803 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
804 ok(arch ==
peI386,
"Expected peI386, got %d\n", arch);
805 ok(
size ==
sizeof(arch),
"Wrong size %ld\n",
size);
807 IAssemblyName_Release(
name);
810 to_widechar(namestr,
"wine, processorArchitecture=AMD64");
813 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
816 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_PROCESSORARCHITECTURE);
817 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
818 ok_aw(
"wine, processorArchitecture=AMD64",
str);
819 ok(
size == 34,
"Expected 34, got %ld\n",
size);
822 hr = IAssemblyName_GetProperty(
name, ASM_NAME_ARCHITECTURE, &arch, &
size);
823 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
824 ok(arch ==
peAMD64,
"Expected peAMD64, got %d\n", arch);
825 ok(
size ==
sizeof(arch),
"Wrong size %ld\n",
size);
827 IAssemblyName_Release(
name);
830 to_widechar(namestr,
"wine, processorArchitecture=IA64");
833 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
836 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_PROCESSORARCHITECTURE);
837 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
838 ok_aw(
"wine, processorArchitecture=IA64",
str);
839 ok(
size == 33,
"Expected 33, got %ld\n",
size);
842 hr = IAssemblyName_GetProperty(
name, ASM_NAME_ARCHITECTURE, &arch, &
size);
843 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
844 ok(arch ==
peIA64,
"Expected peIA64, got %d\n", arch);
845 ok(
size ==
sizeof(arch),
"Wrong size %ld\n",
size);
847 IAssemblyName_Release(
name);
850 to_widechar(namestr,
"wine, processorArchitecture=MSIL");
853 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
856 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_PROCESSORARCHITECTURE);
857 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
858 ok_aw(
"wine, processorArchitecture=MSIL",
str);
859 ok(
size == 33,
"Expected 33, got %ld\n",
size);
862 hr = IAssemblyName_GetProperty(
name, ASM_NAME_ARCHITECTURE, &arch, &
size);
863 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
864 ok(arch ==
peMSIL,
"Expected peMSIL, got %d\n", arch);
865 ok(
size ==
sizeof(arch),
"Wrong size %ld\n",
size);
867 IAssemblyName_Release(
name);
871 to_widechar(namestr,
"wine, Version=1.2.3.4, Culture=en, PublicKeyToken=1234567890abcdef");
874 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
878 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_VERSION | ASM_DISPLAYF_CULTURE);
879 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
880 ok_aw(
"wine, Version=1.2.3.4, Culture=en",
str);
881 ok(
size == 34,
"Expected 34, got %ld\n",
size);
884 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_CULTURE | ASM_DISPLAYF_PUBLIC_KEY_TOKEN);
885 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
886 ok_aw(
"wine, Culture=en, PublicKeyToken=1234567890abcdef",
str);
887 ok(
size == 50,
"Expected 50, got %ld\n",
size);
890 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
891 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
892 ok_aw(
"wine, Version=1.2.3.4, Culture=en, PublicKeyToken=1234567890abcdef",
str);
893 ok(
size == 67,
"Expected 67, got %ld\n",
size);
895 IAssemblyName_Release(
name);
901 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
906 hr = IAssemblyName_GetDisplayName(
name,
str, &
size, ASM_DISPLAYF_FULL);
907 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
914 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
920 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
923 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
924 ok(hi == 0,
"Expected 0, got %08lx\n", hi);
925 ok(lo == 0,
"Expected 0, got %08lx\n", lo);
929 IAssemblyName_Release(
name);
932 to_widechar(namestr,
"wine, PublicKeyToken=567890abcdef");
937 win_skip(
".NET 1.x doesn't check PublicKeyToken correctly\n");
938 IAssemblyName_Release(
name);
942 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
946 to_widechar(namestr,
"wine, PublicKeyToken=1234567890ghijkl");
950 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
954 to_widechar(namestr,
"wine PublicKeyToken=1234567890abcdef");
958 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
967 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
975 "Expected FUSION_E_INVALID_NAME, got %08lx\n",
hr);
982 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
984 hi = lo = 0xdeadbeef;
985 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
986 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
987 ok(hi == 65536,
"Expected 536, got %lu\n", hi);
988 ok(lo == 0,
"Expected 0, got %lu\n", lo);
989 IAssemblyName_Release(
name);
992 to_widechar(namestr,
"wine, version=\"1.0.0.0\",culture=\"en\"");
995 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
997 hi = lo = 0xdeadbeef;
998 hr = IAssemblyName_GetVersion(
name, &hi, &lo);
999 ok(
hr ==
S_OK,
"Expected S_OK, got %08lx\n",
hr);
1000 ok(hi == 65536,
"Expected 65536, got %lu\n", hi);
1001 ok(lo == 0,
"Expected 0, got %lu\n", lo);
1002 IAssemblyName_Release(
name);
1020 hr = IAssemblyName_IsEqual(
name1,
NULL, ASM_CMPF_IL_ALL );
1024 hr = IAssemblyName_IsEqual(
name1,
name1, ASM_CMPF_IL_ALL );
1027 hr = IAssemblyName_IsEqual(
name1,
name2, ASM_CMPF_IL_ALL );
1030 IAssemblyName_Release(
name2 );
1034 hr = IAssemblyName_IsEqual(
name1,
name2, ASM_CMPF_IL_ALL );
1037 IAssemblyName_Release(
name2 );
1038 hr = pCreateAssemblyNameObject( &
name2,
L"wine,version=1.0.0.0,culture=neutral",
1042 hr = IAssemblyName_IsEqual(
name1,
name2, ASM_CMPF_IL_ALL );
1045 IAssemblyName_Release(
name1 );
1046 hr = pCreateAssemblyNameObject( &
name1,
L"wine,version=1.0.0.0,culture=en",
1050 hr = IAssemblyName_IsEqual(
name1,
name2, ASM_CMPF_IL_ALL );
1053 IAssemblyName_Release(
name1 );
1057 IAssemblyName_Release(
name2 );
1058 hr = pCreateAssemblyNameObject( &
name2,
L"wine,version=1.0.0.0,publicKeyToken=1234567890abcdef",
1062 hr = IAssemblyName_IsEqual(
name1,
name2, ASM_CMPF_IL_ALL );
1065 IAssemblyName_Release(
name1 );
1066 IAssemblyName_Release(
name2 );
1073 win_skip(
"fusion.dll not available\n");
#define FUSION_E_INVALID_NAME
#define GetProcAddress(x, y)
#define WideCharToMultiByte
#define MultiByteToWideChar
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
static const WCHAR szDllName[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static LPCWSTR LPVOID pvReserved
static BOOL init_functionpointers(void)
struct _tagASMPROP_RES ASMPROP_RES
static const ASMPROP_RES neutralname[ASM_NAME_MAX_PARAMS]
static const ASMPROP_RES pubkeyname[ASM_NAME_MAX_PARAMS]
static const ASMPROP_RES defaults[ASM_NAME_MAX_PARAMS]
static void test_assembly_name_props_line(IAssemblyName *name, const ASMPROP_RES *vals, int line)
static LPCWSTR DWORD dwFlags
static const ASMPROP_RES vername[ASM_NAME_MAX_PARAMS]
static CHAR string1[MAX_PATH]
static void test_IAssemblyName_IsEqual(void)
static void test_CreateAssemblyNameObject(void)
static const ASMPROP_RES enname[ASM_NAME_MAX_PARAMS]
#define ok_aw(aString, wString)
static LPCWSTR LPVOID HMODULE * phModDll
static const ASMPROP_RES emptyname[ASM_NAME_MAX_PARAMS]
static const ASMPROP_RES badvername[ASM_NAME_MAX_PARAMS]
static const ASMPROP_RES winename[ASM_NAME_MAX_PARAMS]
#define test_assembly_name_props(name, vals)
static void to_widechar(LPWSTR dest, LPCSTR src)
#define STRSAFE_E_INSUFFICIENT_BUFFER
#define E_NOT_SUFFICIENT_BUFFER
@ CANOF_PARSE_DISPLAY_NAME
@ CANOF_SET_DEFAULT_VALUES