[KERNEL32_WINETEST]
authorChristoph von Wittich <christoph_vw@reactos.org>
Fri, 5 Mar 2010 19:01:21 +0000 (19:01 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Fri, 5 Mar 2010 19:01:21 +0000 (19:01 +0000)
sync kernel32_winetest to wine 1.1.39

svn path=/trunk/; revision=45889

19 files changed:
rostests/winetests/kernel32/actctx.c
rostests/winetests/kernel32/alloc.c
rostests/winetests/kernel32/atom.c
rostests/winetests/kernel32/console.c
rostests/winetests/kernel32/debugger.c
rostests/winetests/kernel32/fiber.c [new file with mode: 0644]
rostests/winetests/kernel32/file.c
rostests/winetests/kernel32/generated.c [new file with mode: 0644]
rostests/winetests/kernel32/heap.c
rostests/winetests/kernel32/kernel32.rbuild
rostests/winetests/kernel32/module.c
rostests/winetests/kernel32/path.c
rostests/winetests/kernel32/process.c
rostests/winetests/kernel32/resource.c
rostests/winetests/kernel32/testlist.c
rostests/winetests/kernel32/thread.c
rostests/winetests/kernel32/timer.c
rostests/winetests/kernel32/virtual.c
rostests/winetests/kernel32/volume.c

index 8f51dfb..a158cf3 100644 (file)
@@ -278,7 +278,7 @@ static const detailed_info_t detailed_info2 = {
     work_dir,
 };
 
-static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo)
+static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo, int line)
 {
     ACTIVATION_CONTEXT_DETAILED_INFORMATION detailed_info_tmp, *detailed_info;
     SIZE_T size, exsize, retsize;
@@ -293,9 +293,9 @@ static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo)
         b = pQueryActCtxW(0, handle, NULL,
                           ActivationContextDetailedInformation, &detailed_info_tmp,
                           sizeof(detailed_info_tmp), &size);
-        ok(!b, "QueryActCtx succeeded\n");
-        ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError());
-        ok(size == exsize, "size=%ld, expected %ld\n", size, exsize);
+        ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n");
+        ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError());
+        ok_(__FILE__, line)(size == exsize, "size=%ld, expected %ld\n", size, exsize);
     }else {
         size = sizeof(ACTIVATION_CONTEXT_DETAILED_INFORMATION);
     }
@@ -305,53 +305,53 @@ static void test_detailed_info(HANDLE handle, const detailed_info_t *exinfo)
     b = pQueryActCtxW(0, handle, NULL,
                       ActivationContextDetailedInformation, detailed_info,
                       size, &retsize);
-    ok(b, "QueryActCtx failed: %u\n", GetLastError());
-    ok(retsize == exsize, "size=%ld, expected %ld\n", retsize, exsize);
+    ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError());
+    ok_(__FILE__, line)(retsize == exsize, "size=%ld, expected %ld\n", retsize, exsize);
 
-    ok(detailed_info->dwFlags == 0, "detailed_info->dwFlags=%x\n", detailed_info->dwFlags);
-    ok(detailed_info->ulFormatVersion == exinfo->format_version,
+    ok_(__FILE__, line)(detailed_info->dwFlags == 0, "detailed_info->dwFlags=%x\n", detailed_info->dwFlags);
+    ok_(__FILE__, line)(detailed_info->ulFormatVersion == exinfo->format_version,
        "detailed_info->ulFormatVersion=%u, expected %u\n", detailed_info->ulFormatVersion,
        exinfo->format_version);
-    ok(exinfo->assembly_cnt_min <= detailed_info->ulAssemblyCount &&
+    ok_(__FILE__, line)(exinfo->assembly_cnt_min <= detailed_info->ulAssemblyCount &&
        detailed_info->ulAssemblyCount <= exinfo->assembly_cnt_max,
        "detailed_info->ulAssemblyCount=%u, expected between %u and %u\n", detailed_info->ulAssemblyCount,
        exinfo->assembly_cnt_min, exinfo->assembly_cnt_max);
-    ok(detailed_info->ulRootManifestPathType == exinfo->root_manifest_type,
+    ok_(__FILE__, line)(detailed_info->ulRootManifestPathType == exinfo->root_manifest_type,
        "detailed_info->ulRootManifestPathType=%u, expected %u\n",
        detailed_info->ulRootManifestPathType, exinfo->root_manifest_type);
-    ok(detailed_info->ulRootManifestPathChars ==
+    ok_(__FILE__, line)(detailed_info->ulRootManifestPathChars ==
        (exinfo->root_manifest_path ? lstrlenW(exinfo->root_manifest_path) : 0),
        "detailed_info->ulRootManifestPathChars=%u, expected %u\n",
        detailed_info->ulRootManifestPathChars,
        exinfo->root_manifest_path ?lstrlenW(exinfo->root_manifest_path) : 0);
-    ok(detailed_info->ulRootConfigurationPathType == exinfo->root_config_type,
+    ok_(__FILE__, line)(detailed_info->ulRootConfigurationPathType == exinfo->root_config_type,
        "detailed_info->ulRootConfigurationPathType=%u, expected %u\n",
        detailed_info->ulRootConfigurationPathType, exinfo->root_config_type);
-    ok(detailed_info->ulRootConfigurationPathChars == 0,
+    ok_(__FILE__, line)(detailed_info->ulRootConfigurationPathChars == 0,
        "detailed_info->ulRootConfigurationPathChars=%d\n", detailed_info->ulRootConfigurationPathChars);
-    ok(detailed_info->ulAppDirPathType == exinfo->app_dir_type,
+    ok_(__FILE__, line)(detailed_info->ulAppDirPathType == exinfo->app_dir_type,
        "detailed_info->ulAppDirPathType=%u, expected %u\n", detailed_info->ulAppDirPathType,
        exinfo->app_dir_type);
-    ok(detailed_info->ulAppDirPathChars == (exinfo->app_dir ? lstrlenW(exinfo->app_dir) : 0),
+    ok_(__FILE__, line)(detailed_info->ulAppDirPathChars == (exinfo->app_dir ? lstrlenW(exinfo->app_dir) : 0),
        "detailed_info->ulAppDirPathChars=%u, expected %u\n",
        detailed_info->ulAppDirPathChars, exinfo->app_dir ? lstrlenW(exinfo->app_dir) : 0);
     if(exinfo->root_manifest_path) {
-        ok(detailed_info->lpRootManifestPath != NULL, "detailed_info->lpRootManifestPath == NULL\n");
+        ok_(__FILE__, line)(detailed_info->lpRootManifestPath != NULL, "detailed_info->lpRootManifestPath == NULL\n");
         if(detailed_info->lpRootManifestPath)
-            ok(!lstrcmpiW(detailed_info->lpRootManifestPath, exinfo->root_manifest_path),
+            ok_(__FILE__, line)(!lstrcmpiW(detailed_info->lpRootManifestPath, exinfo->root_manifest_path),
                "unexpected detailed_info->lpRootManifestPath\n");
     }else {
-        ok(detailed_info->lpRootManifestPath == NULL, "detailed_info->lpRootManifestPath != NULL\n");
+        ok_(__FILE__, line)(detailed_info->lpRootManifestPath == NULL, "detailed_info->lpRootManifestPath != NULL\n");
     }
-    ok(detailed_info->lpRootConfigurationPath == NULL,
+    ok_(__FILE__, line)(detailed_info->lpRootConfigurationPath == NULL,
        "detailed_info->lpRootConfigurationPath=%p\n", detailed_info->lpRootConfigurationPath);
     if(exinfo->app_dir) {
-        ok(detailed_info->lpAppDirPath != NULL, "detailed_info->lpAppDirPath == NULL\n");
+        ok_(__FILE__, line)(detailed_info->lpAppDirPath != NULL, "detailed_info->lpAppDirPath == NULL\n");
         if(detailed_info->lpAppDirPath)
-            ok(!lstrcmpiW(exinfo->app_dir, detailed_info->lpAppDirPath),
+            ok_(__FILE__, line)(!lstrcmpiW(exinfo->app_dir, detailed_info->lpAppDirPath),
                "unexpected detailed_info->lpAppDirPath\n%s\n",strw(detailed_info->lpAppDirPath));
     }else {
-        ok(detailed_info->lpAppDirPath == NULL, "detailed_info->lpAppDirPath != NULL\n");
+        ok_(__FILE__, line)(detailed_info->lpAppDirPath == NULL, "detailed_info->lpAppDirPath != NULL\n");
     }
 
     HeapFree(GetProcessHeap(), 0, detailed_info);
@@ -419,7 +419,7 @@ static const info_in_assembly manifest_comctrl_info = {
     0, NULL, NULL, TRUE /* These values may differ between Windows installations */
 };
 
-static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembly *exinfo)
+static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembly *exinfo, int line)
 {
     ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *info, info_tmp;
     SIZE_T size, exsize;
@@ -434,10 +434,10 @@ static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembl
     b = pQueryActCtxW(0, handle, &id,
                       AssemblyDetailedInformationInActivationContext, &info_tmp,
                       sizeof(info_tmp), &size);
-    ok(!b, "QueryActCtx succeeded\n");
-    ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError());
+    ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n");
+    ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError());
 
-    ok(size >= exsize, "size=%lu, expected %lu\n", size, exsize);
+    ok_(__FILE__, line)(size >= exsize, "size=%lu, expected %lu\n", size, exsize);
 
     if (size == 0xdeadbeef)
     {
@@ -451,88 +451,88 @@ static void test_info_in_assembly(HANDLE handle, DWORD id, const info_in_assembl
     size = 0xdeadbeef;
     b = pQueryActCtxW(0, handle, &id,
                       AssemblyDetailedInformationInActivationContext, info, size, &size);
-    ok(b, "QueryActCtx failed: %u\n", GetLastError());
+    ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError());
     if (!exinfo->manifest_path)
         exsize += info->ulManifestPathLength + sizeof(WCHAR);
     if (!exinfo->encoded_assembly_id)
         exsize += info->ulEncodedAssemblyIdentityLength + sizeof(WCHAR);
     if (exinfo->has_assembly_dir)
         exsize += info->ulAssemblyDirectoryNameLength + sizeof(WCHAR);
-    ok(size == exsize, "size=%lu, expected %lu\n", size, exsize);
+    ok_(__FILE__, line)(size == exsize, "size=%lu, expected %lu\n", size, exsize);
 
     if (0)  /* FIXME: flags meaning unknown */
     {
-        ok((info->ulFlags) == exinfo->flags, "info->ulFlags = %x, expected %x\n",
+        ok_(__FILE__, line)((info->ulFlags) == exinfo->flags, "info->ulFlags = %x, expected %x\n",
            info->ulFlags, exinfo->flags);
     }
     if(exinfo->encoded_assembly_id) {
         len = strlen_aw(exinfo->encoded_assembly_id)*sizeof(WCHAR);
-        ok(info->ulEncodedAssemblyIdentityLength == len,
+        ok_(__FILE__, line)(info->ulEncodedAssemblyIdentityLength == len,
            "info->ulEncodedAssemblyIdentityLength = %u, expected %u\n",
            info->ulEncodedAssemblyIdentityLength, len);
     } else {
-        ok(info->ulEncodedAssemblyIdentityLength != 0,
+        ok_(__FILE__, line)(info->ulEncodedAssemblyIdentityLength != 0,
            "info->ulEncodedAssemblyIdentityLength == 0\n");
     }
-    ok(info->ulManifestPathType == ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE,
+    ok_(__FILE__, line)(info->ulManifestPathType == ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE,
        "info->ulManifestPathType = %x\n", info->ulManifestPathType);
     if(exinfo->manifest_path) {
         len = lstrlenW(exinfo->manifest_path)*sizeof(WCHAR);
-        ok(info->ulManifestPathLength == len, "info->ulManifestPathLength = %u, expected %u\n",
+        ok_(__FILE__, line)(info->ulManifestPathLength == len, "info->ulManifestPathLength = %u, expected %u\n",
            info->ulManifestPathLength, len);
     } else {
-        ok(info->ulManifestPathLength != 0, "info->ulManifestPathLength == 0\n");
+        ok_(__FILE__, line)(info->ulManifestPathLength != 0, "info->ulManifestPathLength == 0\n");
     }
 
-    ok(info->ulPolicyPathType == ACTIVATION_CONTEXT_PATH_TYPE_NONE,
+    ok_(__FILE__, line)(info->ulPolicyPathType == ACTIVATION_CONTEXT_PATH_TYPE_NONE,
        "info->ulPolicyPathType = %x\n", info->ulPolicyPathType);
-    ok(info->ulPolicyPathLength == 0,
+    ok_(__FILE__, line)(info->ulPolicyPathLength == 0,
        "info->ulPolicyPathLength = %u, expected 0\n", info->ulPolicyPathLength);
-    ok(info->ulMetadataSatelliteRosterIndex == 0, "info->ulMetadataSatelliteRosterIndex = %x\n",
+    ok_(__FILE__, line)(info->ulMetadataSatelliteRosterIndex == 0, "info->ulMetadataSatelliteRosterIndex = %x\n",
        info->ulMetadataSatelliteRosterIndex);
-    ok(info->ulManifestVersionMajor == 1,"info->ulManifestVersionMajor = %x\n",
+    ok_(__FILE__, line)(info->ulManifestVersionMajor == 1,"info->ulManifestVersionMajor = %x\n",
        info->ulManifestVersionMajor);
-    ok(info->ulManifestVersionMinor == 0, "info->ulManifestVersionMinor = %x\n",
+    ok_(__FILE__, line)(info->ulManifestVersionMinor == 0, "info->ulManifestVersionMinor = %x\n",
        info->ulManifestVersionMinor);
-    ok(info->ulPolicyVersionMajor == 0, "info->ulPolicyVersionMajor = %x\n",
+    ok_(__FILE__, line)(info->ulPolicyVersionMajor == 0, "info->ulPolicyVersionMajor = %x\n",
        info->ulPolicyVersionMajor);
-    ok(info->ulPolicyVersionMinor == 0, "info->ulPolicyVersionMinor = %x\n",
+    ok_(__FILE__, line)(info->ulPolicyVersionMinor == 0, "info->ulPolicyVersionMinor = %x\n",
        info->ulPolicyVersionMinor);
     if(exinfo->has_assembly_dir)
-        ok(info->ulAssemblyDirectoryNameLength != 0,
+        ok_(__FILE__, line)(info->ulAssemblyDirectoryNameLength != 0,
            "info->ulAssemblyDirectoryNameLength == 0\n");
     else
-        ok(info->ulAssemblyDirectoryNameLength == 0,
+        ok_(__FILE__, line)(info->ulAssemblyDirectoryNameLength == 0,
            "info->ulAssemblyDirectoryNameLength != 0\n");
 
-    ok(info->lpAssemblyEncodedAssemblyIdentity != NULL,
+    ok_(__FILE__, line)(info->lpAssemblyEncodedAssemblyIdentity != NULL,
        "info->lpAssemblyEncodedAssemblyIdentity == NULL\n");
     if(info->lpAssemblyEncodedAssemblyIdentity && exinfo->encoded_assembly_id) {
-        ok(!strcmp_aw(info->lpAssemblyEncodedAssemblyIdentity, exinfo->encoded_assembly_id),
+        ok_(__FILE__, line)(!strcmp_aw(info->lpAssemblyEncodedAssemblyIdentity, exinfo->encoded_assembly_id),
            "unexpected info->lpAssemblyEncodedAssemblyIdentity %s / %s\n",
            strw(info->lpAssemblyEncodedAssemblyIdentity), exinfo->encoded_assembly_id);
     }
     if(exinfo->manifest_path) {
-        ok(info->lpAssemblyManifestPath != NULL, "info->lpAssemblyManifestPath == NULL\n");
+        ok_(__FILE__, line)(info->lpAssemblyManifestPath != NULL, "info->lpAssemblyManifestPath == NULL\n");
         if(info->lpAssemblyManifestPath)
-            ok(!lstrcmpiW(info->lpAssemblyManifestPath, exinfo->manifest_path),
+            ok_(__FILE__, line)(!lstrcmpiW(info->lpAssemblyManifestPath, exinfo->manifest_path),
                "unexpected info->lpAssemblyManifestPath\n");
     }else {
-        ok(info->lpAssemblyManifestPath != NULL, "info->lpAssemblyManifestPath == NULL\n");
+        ok_(__FILE__, line)(info->lpAssemblyManifestPath != NULL, "info->lpAssemblyManifestPath == NULL\n");
     }
 
-    ok(info->lpAssemblyPolicyPath == NULL, "info->lpAssemblyPolicyPath != NULL\n");
+    ok_(__FILE__, line)(info->lpAssemblyPolicyPath == NULL, "info->lpAssemblyPolicyPath != NULL\n");
     if(info->lpAssemblyPolicyPath)
-        ok(*(WORD*)info->lpAssemblyPolicyPath == 0, "info->lpAssemblyPolicyPath is not empty\n");
+        ok_(__FILE__, line)(*(WORD*)info->lpAssemblyPolicyPath == 0, "info->lpAssemblyPolicyPath is not empty\n");
     if(exinfo->has_assembly_dir)
-        ok(info->lpAssemblyDirectoryName != NULL, "info->lpAssemblyDirectoryName == NULL\n");
+        ok_(__FILE__, line)(info->lpAssemblyDirectoryName != NULL, "info->lpAssemblyDirectoryName == NULL\n");
     else
-        ok(info->lpAssemblyDirectoryName == NULL, "info->lpAssemblyDirectoryName = %s\n",
+        ok_(__FILE__, line)(info->lpAssemblyDirectoryName == NULL, "info->lpAssemblyDirectoryName = %s\n",
            strw(info->lpAssemblyDirectoryName));
     HeapFree(GetProcessHeap(), 0, info);
 }
 
-static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR filename)
+static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR filename, int line)
 {
     ASSEMBLY_FILE_DETAILED_INFORMATION *info, info_tmp;
     ACTIVATION_CONTEXT_QUERY_INDEX index = {assid, fileid};
@@ -546,9 +546,9 @@ static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR fil
     b = pQueryActCtxW(0, handle, &index,
                       FileInformationInAssemblyOfAssemblyInActivationContext, &info_tmp,
                       sizeof(info_tmp), &size);
-    ok(!b, "QueryActCtx succeeded\n");
-    ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError());
-    ok(size == exsize, "size=%lu, expected %lu\n", size, exsize);
+    ok_(__FILE__, line)(!b, "QueryActCtx succeeded\n");
+    ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() = %u\n", GetLastError());
+    ok_(__FILE__, line)(size == exsize, "size=%lu, expected %lu\n", size, exsize);
 
     if(size == 0xdeadbeef)
     {
@@ -561,18 +561,18 @@ static void test_file_info(HANDLE handle, ULONG assid, ULONG fileid, LPCWSTR fil
 
     b = pQueryActCtxW(0, handle, &index,
                       FileInformationInAssemblyOfAssemblyInActivationContext, info, size, &size);
-    ok(b, "QueryActCtx failed: %u\n", GetLastError());
-    ok(!size, "size=%lu, expected 0\n", size);
+    ok_(__FILE__, line)(b, "QueryActCtx failed: %u\n", GetLastError());
+    ok_(__FILE__, line)(!size, "size=%lu, expected 0\n", size);
 
-    ok(info->ulFlags == 2, "info->ulFlags=%x, expected 2\n", info->ulFlags);
-    ok(info->ulFilenameLength == lstrlenW(filename)*sizeof(WCHAR),
+    ok_(__FILE__, line)(info->ulFlags == 2, "info->ulFlags=%x, expected 2\n", info->ulFlags);
+    ok_(__FILE__, line)(info->ulFilenameLength == lstrlenW(filename)*sizeof(WCHAR),
        "info->ulFilenameLength=%u, expected %u*sizeof(WCHAR)\n",
        info->ulFilenameLength, lstrlenW(filename));
-    ok(info->ulPathLength == 0, "info->ulPathLength=%u\n", info->ulPathLength);
-    ok(info->lpFileName != NULL, "info->lpFileName == NULL\n");
+    ok_(__FILE__, line)(info->ulPathLength == 0, "info->ulPathLength=%u\n", info->ulPathLength);
+    ok_(__FILE__, line)(info->lpFileName != NULL, "info->lpFileName == NULL\n");
     if(info->lpFileName)
-        ok(!lstrcmpiW(info->lpFileName, filename), "unexpected info->lpFileName\n");
-    ok(info->lpFilePath == NULL, "info->lpFilePath != NULL\n");
+        ok_(__FILE__, line)(!lstrcmpiW(info->lpFileName, filename), "unexpected info->lpFileName\n");
+    ok_(__FILE__, line)(info->lpFilePath == NULL, "info->lpFilePath != NULL\n");
     HeapFree(GetProcessHeap(), 0, info);
 }
 
@@ -693,7 +693,7 @@ static void test_create_fail(void)
     test_create_and_fail(manifest2, wrong_depmanifest1, 0 );
 }
 
-static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid)
+static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid, int line)
 {
     ACTCTX_SECTION_KEYED_DATA data;
     DWORD *p;
@@ -705,32 +705,32 @@ static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid
     ret = pFindActCtxSectionStringW(0, NULL,
                                     ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
                                     libname, &data);
-    ok(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
+    ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
     if(!ret)
     {
         skip("couldn't find %s\n",strw(libname));
         return;
     }
 
-    ok(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
-    ok(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
-    ok(data.lpData != NULL, "data.lpData == NULL\n");
-    ok(data.ulLength == 20, "data.ulLength=%u\n", data.ulLength);
+    ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
+    ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
+    ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
+    ok_(__FILE__, line)(data.ulLength == 20, "data.ulLength=%u\n", data.ulLength);
 
     p = data.lpData;
     if(ret && p) todo_wine {
-        ok(p[0] == 20 && p[1] == 2 && p[2] == 0 && p[3] == 0 && p[4] == 0,
+        ok_(__FILE__, line)(p[0] == 20 && p[1] == 2 && p[2] == 0 && p[3] == 0 && p[4] == 0,
            "wrong data %u,%u,%u,%u,%u\n",p[0], p[1], p[2], p[3], p[4]);
     }
 
-    ok(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
-    ok(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
+    ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
+    ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
        data.ulSectionGlobalDataLength);
-    ok(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
-    /* ok(data.ulSectionTotalLength == ??, "data.ulSectionTotalLength=%u\n",
+    ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
+    /* ok_(__FILE__, line)(data.ulSectionTotalLength == ??, "data.ulSectionTotalLength=%u\n",
        data.ulSectionTotalLength); */
-    ok(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
-    ok(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
+    ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
+    ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
        data.ulAssemblyRosterIndex, exid);
 
     memset(&data, 0xfe, sizeof(data));
@@ -739,31 +739,31 @@ static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid
     ret = pFindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
                                     ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION,
                                     libname, &data);
-    ok(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
+    ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
     if(!ret)
     {
         skip("couldn't find\n");
         return;
     }
 
-    ok(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
-    ok(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
-    ok(data.lpData != NULL, "data.lpData == NULL\n");
-    ok(data.ulLength == 20, "data.ulLength=%u\n", data.ulLength);
-    ok(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
-    ok(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
+    ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
+    ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
+    ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
+    ok_(__FILE__, line)(data.ulLength == 20, "data.ulLength=%u\n", data.ulLength);
+    ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
+    ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
        data.ulSectionGlobalDataLength);
-    ok(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
-    /* ok(data.ulSectionTotalLength == ?? , "data.ulSectionTotalLength=%u\n",
+    ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
+    /* ok_(__FILE__, line)(data.ulSectionTotalLength == ?? , "data.ulSectionTotalLength=%u\n",
        data.ulSectionTotalLength); */
-    ok(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx);
-    ok(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
+    ok_(__FILE__, line)(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx);
+    ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
        data.ulAssemblyRosterIndex, exid);
 
     pReleaseActCtx(handle);
 }
 
-static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid)
+static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid, int line)
 {
     ACTCTX_SECTION_KEYED_DATA data;
     BOOL ret;
@@ -774,25 +774,25 @@ static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid)
     ret = pFindActCtxSectionStringW(0, NULL,
                                     ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION,
                                     clsname, &data);
-    ok(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
+    ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
     if(!ret)
     {
         skip("couldn't find\n");
         return;
     }
 
-    ok(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
-    ok(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
-    ok(data.lpData != NULL, "data.lpData == NULL\n");
-    /* ok(data.ulLength == ??, "data.ulLength=%u\n", data.ulLength); */
-    ok(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
-    ok(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
+    ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
+    ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
+    ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
+    /* ok_(__FILE__, line)(data.ulLength == ??, "data.ulLength=%u\n", data.ulLength); */
+    ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
+    ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
        data.ulSectionGlobalDataLength);
-    ok(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
-    /* ok(data.ulSectionTotalLength == 0, "data.ulSectionTotalLength=%u\n",
+    ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
+    /* ok_(__FILE__, line)(data.ulSectionTotalLength == 0, "data.ulSectionTotalLength=%u\n",
        data.ulSectionTotalLength); FIXME */
-    ok(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
-    ok(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
+    ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx);
+    ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
        data.ulAssemblyRosterIndex, exid);
 
     memset(&data, 0xfe, sizeof(data));
@@ -801,25 +801,25 @@ static void test_find_window_class(HANDLE handle, LPCWSTR clsname, ULONG exid)
     ret = pFindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
                                     ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION,
                                     clsname, &data);
-    ok(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
+    ok_(__FILE__, line)(ret, "FindActCtxSectionStringW failed: %u\n", GetLastError());
     if(!ret)
     {
         skip("couldn't find\n");
         return;
     }
 
-    ok(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
-    ok(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
-    ok(data.lpData != NULL, "data.lpData == NULL\n");
-    /* ok(data.ulLength == ??, "data.ulLength=%u\n", data.ulLength); FIXME */
-    ok(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
-    ok(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
+    ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize);
+    ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion);
+    ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n");
+    /* ok_(__FILE__, line)(data.ulLength == ??, "data.ulLength=%u\n", data.ulLength); FIXME */
+    ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n");
+    ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n",
        data.ulSectionGlobalDataLength);
-    ok(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
-    /* ok(data.ulSectionTotalLength == 0, "data.ulSectionTotalLength=%u\n",
+    ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n");
+    /* ok_(__FILE__, line)(data.ulSectionTotalLength == 0, "data.ulSectionTotalLength=%u\n",
        data.ulSectionTotalLength); FIXME */
-    ok(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx);
-    ok(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
+    ok_(__FILE__, line)(data.hActCtx == handle, "data.hActCtx=%p\n", data.hActCtx);
+    ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n",
        data.ulAssemblyRosterIndex, exid);
 
     pReleaseActCtx(handle);
@@ -863,7 +863,7 @@ static void test_find_string_fail(void)
 }
 
 
-static void test_basic_info(HANDLE handle)
+static void test_basic_info(HANDLE handle, int line)
 {
     ACTIVATION_CONTEXT_BASIC_INFORMATION basic;
     SIZE_T size;
@@ -873,10 +873,10 @@ static void test_basic_info(HANDLE handle)
                           ActivationContextBasicInformation, &basic,
                           sizeof(basic), &size);
 
-    ok (b,"ActivationContextBasicInformation failed\n");
-    ok (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n");
-    ok (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags);
-    ok (basic.hActCtx == handle, "unexpected handle\n");
+    ok_(__FILE__, line) (b,"ActivationContextBasicInformation failed\n");
+    ok_(__FILE__, line) (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n");
+    ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags);
+    ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
 
     b = pQueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX |
                       QUERY_ACTCTX_FLAG_NO_ADDREF, handle, NULL,
@@ -884,18 +884,18 @@ static void test_basic_info(HANDLE handle)
                           sizeof(basic), &size);
     if (handle)
     {
-        ok (!b,"ActivationContextBasicInformation succeeded\n");
-        ok (size == 0,"size mismatch\n");
-        ok (GetLastError() == ERROR_INVALID_PARAMETER, "Wrong last error\n");
-        ok (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags);
-        ok (basic.hActCtx == handle, "unexpected handle\n");
+        ok_(__FILE__, line) (!b,"ActivationContextBasicInformation succeeded\n");
+        ok_(__FILE__, line) (size == 0,"size mismatch\n");
+        ok_(__FILE__, line) (GetLastError() == ERROR_INVALID_PARAMETER, "Wrong last error\n");
+        ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags);
+        ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
     }
     else
     {
-        ok (b,"ActivationContextBasicInformation failed\n");
-        ok (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n");
-        ok (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags);
-        ok (basic.hActCtx == handle, "unexpected handle\n");
+        ok_(__FILE__, line) (b,"ActivationContextBasicInformation failed\n");
+        ok_(__FILE__, line) (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n");
+        ok_(__FILE__, line) (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags);
+        ok_(__FILE__, line) (basic.hActCtx == handle, "unexpected handle\n");
     }
 }
 
@@ -913,8 +913,8 @@ static void test_actctx(void)
     ok(handle == NULL, "handle = %p, expected NULL\n", handle);
     ok(b, "GetCurrentActCtx failed: %u\n", GetLastError());
     if(b) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info0);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info0, __LINE__);
         pReleaseActCtx(handle);
     }
 
@@ -928,9 +928,9 @@ static void test_actctx(void)
     handle = test_create("test1.manifest", manifest1);
     DeleteFileA("test1.manifest");
     if(handle != INVALID_HANDLE_VALUE) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info1);
-        test_info_in_assembly(handle, 1, &manifest1_info);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info1, __LINE__);
+        test_info_in_assembly(handle, 1, &manifest1_info, __LINE__);
 
         if (pIsDebuggerPresent && !pIsDebuggerPresent())
         {
@@ -954,10 +954,10 @@ static void test_actctx(void)
     DeleteFileA("test2.manifest");
     DeleteFileA("testdep.manifest");
     if(handle != INVALID_HANDLE_VALUE) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info2);
-        test_info_in_assembly(handle, 1, &manifest2_info);
-        test_info_in_assembly(handle, 2, &depmanifest1_info);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info2, __LINE__);
+        test_info_in_assembly(handle, 1, &manifest2_info, __LINE__);
+        test_info_in_assembly(handle, 2, &depmanifest1_info, __LINE__);
         pReleaseActCtx(handle);
     }
 
@@ -972,17 +972,17 @@ static void test_actctx(void)
     DeleteFileA("test2-2.manifest");
     DeleteFileA("testdep.manifest");
     if(handle != INVALID_HANDLE_VALUE) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info2);
-        test_info_in_assembly(handle, 1, &manifest2_info);
-        test_info_in_assembly(handle, 2, &depmanifest2_info);
-        test_file_info(handle, 1, 0, testlib_dll);
-        test_file_info(handle, 1, 1, testlib2_dll);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info2, __LINE__);
+        test_info_in_assembly(handle, 1, &manifest2_info, __LINE__);
+        test_info_in_assembly(handle, 2, &depmanifest2_info, __LINE__);
+        test_file_info(handle, 1, 0, testlib_dll, __LINE__);
+        test_file_info(handle, 1, 1, testlib2_dll, __LINE__);
 
         b = pActivateActCtx(handle, &cookie);
         ok(b, "ActivateActCtx failed: %u\n", GetLastError());
-        test_find_dll_redirection(handle, testlib_dll, 2);
-        test_find_dll_redirection(handle, testlib2_dll, 2);
+        test_find_dll_redirection(handle, testlib_dll, 2, __LINE__);
+        test_find_dll_redirection(handle, testlib2_dll, 2, __LINE__);
         b = pDeactivateActCtx(0, cookie);
         ok(b, "DeactivateActCtx failed: %u\n", GetLastError());
 
@@ -1000,19 +1000,19 @@ static void test_actctx(void)
     DeleteFileA("test2-3.manifest");
     DeleteFileA("testdep.manifest");
     if(handle != INVALID_HANDLE_VALUE) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info2);
-        test_info_in_assembly(handle, 1, &manifest2_info);
-        test_info_in_assembly(handle, 2, &depmanifest3_info);
-        test_file_info(handle, 1, 0, testlib_dll);
-        test_file_info(handle, 1, 1, testlib2_dll);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info2, __LINE__);
+        test_info_in_assembly(handle, 1, &manifest2_info, __LINE__);
+        test_info_in_assembly(handle, 2, &depmanifest3_info, __LINE__);
+        test_file_info(handle, 1, 0, testlib_dll, __LINE__);
+        test_file_info(handle, 1, 1, testlib2_dll, __LINE__);
 
         b = pActivateActCtx(handle, &cookie);
         ok(b, "ActivateActCtx failed: %u\n", GetLastError());
-        test_find_dll_redirection(handle, testlib_dll, 2);
-        test_find_dll_redirection(handle, testlib2_dll, 2);
-        test_find_window_class(handle, wndClassW, 2);
-        test_find_window_class(handle, wndClass2W, 2);
+        test_find_dll_redirection(handle, testlib_dll, 2, __LINE__);
+        test_find_dll_redirection(handle, testlib2_dll, 2, __LINE__);
+        test_find_window_class(handle, wndClassW, 2, __LINE__);
+        test_find_window_class(handle, wndClass2W, 2, __LINE__);
         b = pDeactivateActCtx(0, cookie);
         ok(b, "DeactivateActCtx failed: %u\n", GetLastError());
 
@@ -1029,15 +1029,15 @@ static void test_actctx(void)
     handle = test_create("test3.manifest", manifest3);
     DeleteFileA("test3.manifest");
     if(handle != INVALID_HANDLE_VALUE) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info1);
-        test_info_in_assembly(handle, 1, &manifest3_info);
-        test_file_info(handle, 0, 0, testlib_dll);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info1, __LINE__);
+        test_info_in_assembly(handle, 1, &manifest3_info, __LINE__);
+        test_file_info(handle, 0, 0, testlib_dll, __LINE__);
 
         b = pActivateActCtx(handle, &cookie);
         ok(b, "ActivateActCtx failed: %u\n", GetLastError());
-        test_find_dll_redirection(handle, testlib_dll, 1);
-        test_find_dll_redirection(handle, testlib_dll, 1);
+        test_find_dll_redirection(handle, testlib_dll, 1, __LINE__);
+        test_find_dll_redirection(handle, testlib_dll, 1, __LINE__);
         test_find_string_fail();
         b = pDeactivateActCtx(0, cookie);
         ok(b, "DeactivateActCtx failed: %u\n", GetLastError());
@@ -1056,10 +1056,10 @@ static void test_actctx(void)
     DeleteFileA("test4.manifest");
     DeleteFileA("testdep.manifest");
     if(handle != INVALID_HANDLE_VALUE) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info2);
-        test_info_in_assembly(handle, 1, &manifest4_info);
-        test_info_in_assembly(handle, 2, &manifest_comctrl_info);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info2, __LINE__);
+        test_info_in_assembly(handle, 1, &manifest4_info, __LINE__);
+        test_info_in_assembly(handle, 2, &manifest_comctrl_info, __LINE__);
         pReleaseActCtx(handle);
     }
 
@@ -1075,9 +1075,9 @@ static void test_actctx(void)
         handle = test_create("..\\test1.manifest", manifest1);
         DeleteFileA("..\\test1.manifest");
         if(handle != INVALID_HANDLE_VALUE) {
-            test_basic_info(handle);
-            test_detailed_info(handle, &detailed_info1);
-            test_info_in_assembly(handle, 1, &manifest1_info);
+            test_basic_info(handle, __LINE__);
+            test_detailed_info(handle, &detailed_info1, __LINE__);
+            test_info_in_assembly(handle, 1, &manifest1_info, __LINE__);
             pReleaseActCtx(handle);
         }
         SetCurrentDirectoryW(work_dir);
@@ -1095,9 +1095,9 @@ static void test_actctx(void)
     handle = test_create("test1.manifest", manifest1);
     DeleteFileA("test1.manifest");
     if (handle != INVALID_HANDLE_VALUE) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info1);
-        test_info_in_assembly(handle, 1, &manifest1_info);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info1, __LINE__);
+        test_info_in_assembly(handle, 1, &manifest1_info, __LINE__);
         pReleaseActCtx(handle);
     }
 
@@ -1110,9 +1110,9 @@ static void test_actctx(void)
     handle = test_create("test1.manifest", manifest1);
     DeleteFileA("test1.manifest");
     if (handle != INVALID_HANDLE_VALUE) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info1);
-        test_info_in_assembly(handle, 1, &manifest1_info);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info1, __LINE__);
+        test_info_in_assembly(handle, 1, &manifest1_info, __LINE__);
         pReleaseActCtx(handle);
     }
 
@@ -1129,9 +1129,9 @@ static void test_app_manifest(void)
     ok(handle == NULL, "handle != NULL\n");
     ok(b, "GetCurrentActCtx failed: %u\n", GetLastError());
     if(b) {
-        test_basic_info(handle);
-        test_detailed_info(handle, &detailed_info1_child);
-        test_info_in_assembly(handle, 1, &manifest1_child_info);
+        test_basic_info(handle, __LINE__);
+        test_detailed_info(handle, &detailed_info1_child, __LINE__);
+        test_info_in_assembly(handle, 1, &manifest1_child_info, __LINE__);
         pReleaseActCtx(handle);
     }
 }
index 8cb0915..c1b2afc 100755 (executable)
@@ -70,15 +70,9 @@ static void test_Heap(void)
     heap=HeapCreate(0,2*memchunk,5*memchunk);
 
 /* Check that HeapCreate allocated the right amount of ram */
-    todo_wine {
-    /* Today HeapCreate seems to return a memory block larger than specified.
-       MSDN says the maximum heap size should be dwMaximumSize rounded up to the
-       nearest page boundary
-    */
-      mem1=HeapAlloc(heap,0,5*memchunk+1);
-      ok(mem1==NULL,"HeapCreate allocated more Ram than it should have\n");
-      HeapFree(heap,0,mem1);
-    }
+    mem1=HeapAlloc(heap,0,5*memchunk+1);
+    ok(mem1==NULL,"HeapCreate allocated more Ram than it should have\n");
+    HeapFree(heap,0,mem1);
 
 /* Check that a normal alloc works */
     mem1=HeapAlloc(heap,0,memchunk);
index 84013b9..f85d272 100755 (executable)
@@ -32,6 +32,7 @@
 static const WCHAR foobarW[] = {'f','o','o','b','a','r',0};
 static const WCHAR FOOBARW[] = {'F','O','O','B','A','R',0};
 static const WCHAR _foobarW[] = {'_','f','o','o','b','a','r',0};
+static const WCHAR integfmt[] = {'#','%','d',0};
 
 static void do_initA(char* tmp, const char* pattern, int len)
 {
@@ -57,21 +58,6 @@ static void do_initW(WCHAR* tmp, const char* pattern, int len)
     *tmp = '\0';
 }
 
-static void print_integral( WCHAR* buffer, int atom )
-{
-    BOOL first = TRUE;
-
-#define X(v) { if (atom >= v) {*buffer++ = '0' + atom / v; first = FALSE; } else if (!first || v == 1) *buffer++ = '0'; atom %= v; }
-    *buffer++ = '#';
-    X(10000);
-    X(1000);
-    X(100);
-    X(10);
-    X(1);
-    *buffer = '\0';
-#undef X
-}
-
 static BOOL unicode_OS;
 
 static void test_add_atom(void)
@@ -281,7 +267,7 @@ static void test_get_atom_name(void)
                 WCHAR res[20];
                 
                 ok( (len > 1) && (len < 7), "bad length %d\n", len );
-                print_integral( res, i );
+                wsprintfW( res, integfmt, i );
                 memset( res + lstrlenW(res) + 1, 'a', 10 * sizeof(WCHAR));
                 ok( !memcmp( res, outW, 10 * sizeof(WCHAR) ), "bad buffer contents for %d\n", i );
                 if (len <= 1 || len >= 7) break;  /* don't bother testing all of them */
@@ -552,7 +538,7 @@ static void test_local_get_atom_name(void)
                 WCHAR res[20];
                 
                 ok( (len > 1) && (len < 7), "bad length %d\n", len );
-                print_integral( res, i );
+                wsprintfW( res, integfmt, i );
                 memset( res + lstrlenW(res) + 1, 'a', 10 * sizeof(WCHAR));
                 ok( !memcmp( res, outW, 10 * sizeof(WCHAR) ), "bad buffer contents for %d\n", i );
             }
index 33eab26..ace4744 100755 (executable)
@@ -24,6 +24,7 @@
 #include <stdio.h>
 
 static BOOL (WINAPI *pGetConsoleInputExeNameA)(DWORD, LPSTR);
+static DWORD (WINAPI *pGetConsoleProcessList)(LPDWORD, DWORD);
 static BOOL (WINAPI *pSetConsoleInputExeNameA)(LPCSTR);
 
 /* DEFAULT_ATTRIB is used for all initial filling of the console.
@@ -63,6 +64,7 @@ static void init_function_pointers(void)
 
     hKernel32 = GetModuleHandleA("kernel32.dll");
     KERNEL32_GET_PROC(GetConsoleInputExeNameA);
+    KERNEL32_GET_PROC(GetConsoleProcessList);
     KERNEL32_GET_PROC(SetConsoleInputExeNameA);
 
 #undef KERNEL32_GET_PROC
@@ -926,6 +928,66 @@ static void test_GetSetConsoleInputExeName(void)
     ok(!lstrcmpA(buffer, input_exe), "got %s expected %s\n", buffer, input_exe);
 }
 
+static void test_GetConsoleProcessList(void)
+{
+    DWORD ret, *list = NULL;
+
+    if (!pGetConsoleProcessList)
+    {
+        win_skip("GetConsoleProcessList is not available\n");
+        return;
+    }
+
+    SetLastError(0xdeadbeef);
+    ret = pGetConsoleProcessList(NULL, 0);
+    ok(ret == 0, "Expected failure\n");
+    ok(GetLastError() == ERROR_INVALID_PARAMETER,
+       "Expected ERROR_INVALID_PARAMETER, got %d\n",
+       GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ret = pGetConsoleProcessList(NULL, 1);
+    ok(ret == 0, "Expected failure\n");
+    ok(GetLastError() == ERROR_INVALID_PARAMETER,
+       "Expected ERROR_INVALID_PARAMETER, got %d\n",
+       GetLastError());
+
+    /* We should only have 1 process but only for these specific unit tests as
+     * we created our own console. An AttachConsole(ATTACH_PARENT_PROCESS) would
+     * give us two processes for example.
+     */
+    list = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD));
+
+    SetLastError(0xdeadbeef);
+    ret = pGetConsoleProcessList(list, 0);
+    ok(ret == 0, "Expected failure\n");
+    ok(GetLastError() == ERROR_INVALID_PARAMETER,
+       "Expected ERROR_INVALID_PARAMETER, got %d\n",
+       GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ret = pGetConsoleProcessList(list, 1);
+    todo_wine
+    ok(ret == 1, "Expected 1, got %d\n", ret);
+
+    HeapFree(GetProcessHeap(), 0, list);
+
+    list = HeapAlloc(GetProcessHeap(), 0, ret * sizeof(DWORD));
+
+    SetLastError(0xdeadbeef);
+    ret = pGetConsoleProcessList(list, ret);
+    todo_wine
+    ok(ret == 1, "Expected 1, got %d\n", ret);
+
+    if (ret == 1)
+    {
+        DWORD pid = GetCurrentProcessId();
+        ok(list[0] == pid, "Expected %d, got %d\n", pid, list[0]);
+    }
+
+    HeapFree(GetProcessHeap(), 0, list);
+}
+
 START_TEST(console)
 {
     HANDLE hConIn, hConOut;
@@ -971,10 +1033,9 @@ START_TEST(console)
     /* still to be done: access rights & access on objects */
 
     if (!pGetConsoleInputExeNameA || !pSetConsoleInputExeNameA)
-    {
         win_skip("GetConsoleInputExeNameA and/or SetConsoleInputExeNameA is not available\n");
-        return;
-    }
     else
         test_GetSetConsoleInputExeName();
+
+    test_GetConsoleProcessList();
 }
index 4cf8c05..b0f3b40 100644 (file)
@@ -411,7 +411,10 @@ static void test_ExitCode(void)
         crash_and_debug(hkey, test_exe, "dbg,none");
     else
         skip("\"none\" debugger test needs user interaction\n");
-    crash_and_debug(hkey, test_exe, "dbg,event,order");
+    if (disposition == REG_CREATED_NEW_KEY)
+        win_skip("'dbg,event,order' test doesn't finish on Win9x/WinMe\n");
+    else
+        crash_and_debug(hkey, test_exe, "dbg,event,order");
     crash_and_debug(hkey, test_exe, "dbg,attach,event,code2");
     if (pDebugSetProcessKillOnExit)
         crash_and_debug(hkey, test_exe, "dbg,attach,event,nokill");
diff --git a/rostests/winetests/kernel32/fiber.c b/rostests/winetests/kernel32/fiber.c
new file mode 100644 (file)
index 0000000..dac9d6a
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * Unit tests for fiber functions
+ *
+ * Copyright (c) 2010 AndrĂ© Hentschel
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "wine/test.h"
+
+static LPVOID (WINAPI *pCreateFiber)(SIZE_T,LPFIBER_START_ROUTINE,LPVOID);
+static LPVOID (WINAPI *pConvertThreadToFiber)(LPVOID);
+static BOOL (WINAPI *pConvertFiberToThread)(void);
+static void (WINAPI *pSwitchToFiber)(LPVOID);
+static void (WINAPI *pDeleteFiber)(LPVOID);
+static LPVOID (WINAPI *pConvertThreadToFiberEx)(LPVOID,DWORD);
+static LPVOID (WINAPI *pCreateFiberEx)(SIZE_T,SIZE_T,DWORD,LPFIBER_START_ROUTINE,LPVOID);
+static BOOL (WINAPI *pIsThreadAFiber)(void);
+static DWORD (WINAPI *pFlsAlloc)(PFLS_CALLBACK_FUNCTION);
+static BOOL (WINAPI *pFlsFree)(DWORD);
+static PVOID (WINAPI *pFlsGetValue)(DWORD);
+static BOOL (WINAPI *pFlsSetValue)(DWORD,PVOID);
+
+static LPVOID fibers[2];
+static BYTE testparam = 185;
+static WORD cbCount;
+
+static VOID init_funcs(void)
+{
+    HMODULE hKernel32 = GetModuleHandle("kernel32");
+
+#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f);
+    X(CreateFiber);
+    X(ConvertThreadToFiber);
+    X(ConvertFiberToThread);
+    X(SwitchToFiber);
+    X(DeleteFiber);
+    X(ConvertThreadToFiberEx);
+    X(CreateFiberEx);
+    X(IsThreadAFiber);
+    X(FlsAlloc);
+    X(FlsFree);
+    X(FlsGetValue);
+    X(FlsSetValue);
+#undef X
+}
+
+static VOID WINAPI FiberLocalStorageProc(PVOID lpFlsData)
+{
+    cbCount++;
+    ok(lpFlsData == (PVOID) 1587, "FlsData expected not to be changed\n");
+}
+
+static VOID WINAPI FiberMainProc(LPVOID lpFiberParameter)
+{
+    BYTE *tparam = (BYTE *)lpFiberParameter;
+    cbCount++;
+    ok(*tparam == 185, "Parameterdata expected not to be changed\n");
+    pSwitchToFiber(fibers[0]);
+}
+
+static void test_ConvertThreadToFiber(void)
+{
+    if (pConvertThreadToFiber)
+    {
+        fibers[0] = pConvertThreadToFiber(&testparam);
+        ok(fibers[0] != 0, "ConvertThreadToFiber failed with error %d\n", GetLastError());
+    }
+    else
+    {
+        win_skip( "ConvertThreadToFiber not present\n" );
+    }
+}
+
+static void test_ConvertThreadToFiberEx(void)
+{
+    if (pConvertThreadToFiberEx)
+    {
+        fibers[0] = pConvertThreadToFiberEx(&testparam, 0);
+        ok(fibers[0] != 0, "ConvertThreadToFiberEx failed with error %d\n", GetLastError());
+    }
+    else
+    {
+        win_skip( "ConvertThreadToFiberEx not present\n" );
+    }
+}
+
+static void test_ConvertFiberToThread(void)
+{
+    if (pConvertFiberToThread)
+    {
+        ok(pConvertFiberToThread() , "ConvertFiberToThread failed with error %d\n", GetLastError());
+    }
+    else
+    {
+        win_skip( "ConvertFiberToThread not present\n" );
+    }
+}
+
+static void test_FiberHandling(void)
+{
+    cbCount = 0;
+    fibers[0] = pCreateFiber(0,FiberMainProc,&testparam);
+    ok(fibers[0] != 0, "CreateFiber failed with error %d\n", GetLastError());
+    pDeleteFiber(fibers[0]);
+
+    test_ConvertThreadToFiber();
+    test_ConvertFiberToThread();
+    if (pConvertThreadToFiberEx)
+        test_ConvertThreadToFiberEx();
+    else
+        test_ConvertThreadToFiber();
+
+
+    fibers[1] = pCreateFiber(0,FiberMainProc,&testparam);
+    ok(fibers[1] != 0, "CreateFiber failed with error %d\n", GetLastError());
+
+    pSwitchToFiber(fibers[1]);
+    ok(cbCount == 1, "Wrong callback count: %d\n", cbCount);
+    pDeleteFiber(fibers[1]);
+
+    if (!pCreateFiberEx)
+    {
+        win_skip( "CreateFiberEx not present\n" );
+        return;
+    }
+
+    fibers[1] = pCreateFiberEx(0,0,0,FiberMainProc,&testparam);
+    ok(fibers[1] != 0, "CreateFiberEx failed with error %d\n", GetLastError());
+
+    pSwitchToFiber(fibers[1]);
+    ok(cbCount == 2, "Wrong callback count: %d\n", cbCount);
+    pDeleteFiber(fibers[1]);
+
+    if (!pIsThreadAFiber)
+    {
+        win_skip( "IsThreadAFiber not present\n" );
+        return;
+    }
+
+    ok(pIsThreadAFiber(), "IsThreadAFiber reported FALSE\n");
+    test_ConvertFiberToThread();
+    ok(!pIsThreadAFiber(), "IsThreadAFiber reported TRUE\n");
+}
+
+static void test_FiberLocalStorage(PFLS_CALLBACK_FUNCTION cbfunc)
+{
+    DWORD fls;
+    BOOL ret;
+    PVOID val = (PVOID) 1587;
+
+    if (!pFlsAlloc)
+    {
+        win_skip( "Fiber Local Storage not supported\n" );
+        return;
+    }
+    cbCount = 0;
+
+    fls = pFlsAlloc(cbfunc);
+    ok(fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed with error %d\n", GetLastError());
+
+    ret = pFlsSetValue(fls, val);
+    ok(ret, "FlsSetValue failed\n");
+    ok(val == pFlsGetValue(fls), "FlsGetValue failed\n");
+
+    ret = pFlsFree(fls);
+    ok(ret, "FlsFree failed\n");
+    if (cbfunc)
+        todo_wine ok(cbCount == 1, "Wrong callback count: %d\n", cbCount);
+}
+
+START_TEST(fiber)
+{
+    init_funcs();
+
+    if (!pCreateFiber)
+    {
+        win_skip( "Fibers not supported by win95\n" );
+        return;
+    }
+
+    test_FiberHandling();
+    test_FiberLocalStorage(NULL);
+    test_FiberLocalStorage(FiberLocalStorageProc);
+}
index 3cc9022..3493ff3 100755 (executable)
@@ -202,6 +202,8 @@ static void test__hwrite( void )
 
     ret = DeleteFileA( filename );
     ok( ret != 0, "DeleteFile failed (%d)\n", GetLastError(  ) );
+
+    LocalFree( contents );
 }
 
 
@@ -251,7 +253,9 @@ static void test__lcreat( void )
 
     ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
 
-    ok( INVALID_HANDLE_VALUE != FindFirstFileA( filename, &search_results ), "should be able to find file\n" );
+    find = FindFirstFileA( filename, &search_results );
+    ok( INVALID_HANDLE_VALUE != find, "should be able to find file\n" );
+    FindClose( find );
 
     ret = DeleteFileA(filename);
     ok( ret != 0, "DeleteFile failed (%d)\n", GetLastError());
@@ -263,7 +267,9 @@ static void test__lcreat( void )
 
     ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
 
-    ok( INVALID_HANDLE_VALUE != FindFirstFileA( filename, &search_results ), "should be able to find file\n" );
+    find = FindFirstFileA( filename, &search_results );
+    ok( INVALID_HANDLE_VALUE != find, "should be able to find file\n" );
+    FindClose( find );
 
     ok( 0 == DeleteFileA( filename ), "shouldn't be able to delete a readonly file\n" );
 
@@ -282,7 +288,9 @@ static void test__lcreat( void )
 
     ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
 
-    ok( INVALID_HANDLE_VALUE != FindFirstFileA( filename, &search_results ), "should STILL be able to find file\n" );
+    find = FindFirstFileA( filename, &search_results );
+    ok( INVALID_HANDLE_VALUE != find, "should STILL be able to find file\n" );
+    FindClose( find );
 
     ret = DeleteFileA( filename );
     ok( ret, "DeleteFile failed (%d)\n", GetLastError(  ) );
@@ -298,7 +306,9 @@ static void test__lcreat( void )
 
     ok( HFILE_ERROR != _lclose(filehandle), "_lclose complains\n" );
 
-    ok( INVALID_HANDLE_VALUE != FindFirstFileA( filename, &search_results ), "should STILL be able to find file\n" );
+    find = FindFirstFileA( filename, &search_results );
+    ok( INVALID_HANDLE_VALUE != find, "should STILL be able to find file\n" );
+    FindClose( find );
 
     ret = DeleteFileA( filename );
     ok( ret, "DeleteFile failed (%d)\n", GetLastError(  ) );
@@ -555,6 +565,8 @@ static void test__lwrite( void )
 
     ret = DeleteFileA( filename );
     ok( ret, "DeleteFile failed (%d)\n", GetLastError(  ) );
+
+    LocalFree( contents );
 }
 
 static void test_CopyFileA(void)
@@ -702,33 +714,22 @@ static void test_CopyFileW(void)
 /*
  *   Debugging routine to dump a buffer in a hexdump-like fashion.
  */
-static void dumpmem(unsigned char* mem, int len) {
-    int x,y;
-    char buf[200];
-    int ln=0;
-
-    for (x=0; x<len; x+=16) {
-        ln += sprintf(buf+ln, "%04x: ",x);
-        for (y=0; y<16; y++) {
-            if ((x+y)>len) {
-                ln += sprintf(buf+ln, "   ");
-            } else {
-                ln += sprintf(buf+ln, "%02hhx ",mem[x+y]);
-            }
-        }
-        ln += sprintf(buf+ln, "- ");
-        for (y=0; y<16; y++) {
-            if ((x+y)<=len) {
-                if (mem[x+y]<32 || mem[x+y]>127) {
-                    ln += sprintf(buf+ln, ".");
-                } else {
-                    ln += sprintf(buf+ln, "%c",mem[x+y]);
-                }
-            }
-        }
-        sprintf(buf+ln, "\n");
-        trace(buf);
-        ln = 0;
+static void dumpmem(unsigned char *mem, int len)
+{
+    int x = 0;
+    char hex[49], *p;
+    char txt[17], *c;
+
+    while (x < len)
+    {
+        p = hex;
+        c = txt;
+        do {
+            p += sprintf(p, "%02hhx ", mem[x]);
+            *c++ = (mem[x] >= 32 && mem[x] <= 127) ? mem[x] : '.';
+        } while (++x % 16 && x < len);
+        *c = '\0';
+        trace("%04x: %-48s- %s\n", x, hex, txt);
     }
 }
 
diff --git a/rostests/winetests/kernel32/generated.c b/rostests/winetests/kernel32/generated.c
new file mode 100644 (file)
index 0000000..be68a08
--- /dev/null
@@ -0,0 +1,2080 @@
+/* File generated automatically from tools/winapi/tests.dat; do not edit! */
+/* This file can be copied, modified and distributed without restriction. */
+
+/*
+ * Unit tests for data structure packing
+ */
+
+#define WINVER 0x0501
+#define _WIN32_IE 0x0501
+#define _WIN32_WINNT 0x0501
+
+#define WINE_NOWINSOCK
+
+#include "windows.h"
+
+#include "wine/test.h"
+
+/***********************************************************************
+ * Compatibility macros
+ */
+
+#define DWORD_PTR UINT_PTR
+#define LONG_PTR INT_PTR
+#define ULONG_PTR UINT_PTR
+
+/***********************************************************************
+ * Windows API extension
+ */
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
+# define _TYPE_ALIGNMENT(type) __alignof(type)
+#elif defined(__GNUC__)
+# define _TYPE_ALIGNMENT(type) __alignof__(type)
+#else
+/*
+ * FIXME: May not be possible without a compiler extension
+ *        (if type is not just a name that is, otherwise the normal
+ *         TYPE_ALIGNMENT can be used)
+ */
+#endif
+
+#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
+#pragma warning(disable:4116)
+#endif
+
+#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
+# define TYPE_ALIGNMENT _TYPE_ALIGNMENT
+#endif
+
+/***********************************************************************
+ * Test helper macros
+ */
+
+#ifdef _WIN64
+
+# define TEST_TYPE_SIZE(type, size)
+# define TEST_TYPE_ALIGN(type, align)
+# define TEST_TARGET_ALIGN(type, align)
+# define TEST_FIELD_ALIGN(type, field, align)
+# define TEST_FIELD_OFFSET(type, field, offset)
+
+#else
+
+# define TEST_TYPE_SIZE(type, size)             C_ASSERT(sizeof(type) == size);
+
+# ifdef TYPE_ALIGNMENT
+#  define TEST_TYPE_ALIGN(type, align)          C_ASSERT(TYPE_ALIGNMENT(type) == align);
+# else
+#  define TEST_TYPE_ALIGN(type, align)
+# endif
+
+# ifdef _TYPE_ALIGNMENT
+#  define TEST_TARGET_ALIGN(type, align)        C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);
+#  define TEST_FIELD_ALIGN(type, field, align)  C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);
+# else
+#  define TEST_TARGET_ALIGN(type, align)
+#  define TEST_FIELD_ALIGN(type, field, align)
+# endif
+
+# define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);
+
+#endif
+
+#define TEST_TARGET_SIZE(type, size)            TEST_TYPE_SIZE(*(type)0, size)
+#define TEST_FIELD_SIZE(type, field, size)      TEST_TYPE_SIZE((((type*)0)->field), size)
+#define TEST_TYPE_SIGNED(type)                  C_ASSERT((type) -1 < 0);
+#define TEST_TYPE_UNSIGNED(type)                C_ASSERT((type) -1 > 0);
+
+
+static void test_pack_LPOSVERSIONINFOA(void)
+{
+    /* LPOSVERSIONINFOA */
+    TEST_TYPE_SIZE   (LPOSVERSIONINFOA, 4)
+    TEST_TYPE_ALIGN  (LPOSVERSIONINFOA, 4)
+    TEST_TARGET_SIZE (LPOSVERSIONINFOA, 148)
+    TEST_TARGET_ALIGN(LPOSVERSIONINFOA, 4)
+}
+
+static void test_pack_LPOSVERSIONINFOEXA(void)
+{
+    /* LPOSVERSIONINFOEXA */
+    TEST_TYPE_SIZE   (LPOSVERSIONINFOEXA, 4)
+    TEST_TYPE_ALIGN  (LPOSVERSIONINFOEXA, 4)
+    TEST_TARGET_SIZE (LPOSVERSIONINFOEXA, 156)
+    TEST_TARGET_ALIGN(LPOSVERSIONINFOEXA, 4)
+}
+
+static void test_pack_LPOSVERSIONINFOEXW(void)
+{
+    /* LPOSVERSIONINFOEXW */
+    TEST_TYPE_SIZE   (LPOSVERSIONINFOEXW, 4)
+    TEST_TYPE_ALIGN  (LPOSVERSIONINFOEXW, 4)
+    TEST_TARGET_SIZE (LPOSVERSIONINFOEXW, 284)
+    TEST_TARGET_ALIGN(LPOSVERSIONINFOEXW, 4)
+}
+
+static void test_pack_LPOSVERSIONINFOW(void)
+{
+    /* LPOSVERSIONINFOW */
+    TEST_TYPE_SIZE   (LPOSVERSIONINFOW, 4)
+    TEST_TYPE_ALIGN  (LPOSVERSIONINFOW, 4)
+    TEST_TARGET_SIZE (LPOSVERSIONINFOW, 276)
+    TEST_TARGET_ALIGN(LPOSVERSIONINFOW, 4)
+}
+
+static void test_pack_OSVERSIONINFOA(void)
+{
+    /* OSVERSIONINFOA (pack 4) */
+    TEST_TYPE_SIZE   (OSVERSIONINFOA, 148)
+    TEST_TYPE_ALIGN  (OSVERSIONINFOA, 4)
+    TEST_FIELD_SIZE  (OSVERSIONINFOA, dwOSVersionInfoSize, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOA, dwOSVersionInfoSize, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOA, dwOSVersionInfoSize, 0)
+    TEST_FIELD_SIZE  (OSVERSIONINFOA, dwMajorVersion, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOA, dwMajorVersion, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOA, dwMajorVersion, 4)
+    TEST_FIELD_SIZE  (OSVERSIONINFOA, dwMinorVersion, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOA, dwMinorVersion, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOA, dwMinorVersion, 8)
+    TEST_FIELD_SIZE  (OSVERSIONINFOA, dwBuildNumber, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOA, dwBuildNumber, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOA, dwBuildNumber, 12)
+    TEST_FIELD_SIZE  (OSVERSIONINFOA, dwPlatformId, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOA, dwPlatformId, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOA, dwPlatformId, 16)
+    TEST_FIELD_SIZE  (OSVERSIONINFOA, szCSDVersion, 128)
+    TEST_FIELD_ALIGN (OSVERSIONINFOA, szCSDVersion, 1)
+    TEST_FIELD_OFFSET(OSVERSIONINFOA, szCSDVersion, 20)
+}
+
+static void test_pack_OSVERSIONINFOEXA(void)
+{
+    /* OSVERSIONINFOEXA (pack 4) */
+    TEST_TYPE_SIZE   (OSVERSIONINFOEXA, 156)
+    TEST_TYPE_ALIGN  (OSVERSIONINFOEXA, 4)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, dwOSVersionInfoSize, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwOSVersionInfoSize, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwOSVersionInfoSize, 0)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, dwMajorVersion, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwMajorVersion, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwMajorVersion, 4)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, dwMinorVersion, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwMinorVersion, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwMinorVersion, 8)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, dwBuildNumber, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwBuildNumber, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwBuildNumber, 12)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, dwPlatformId, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, dwPlatformId, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, dwPlatformId, 16)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, szCSDVersion, 128)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, szCSDVersion, 1)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, szCSDVersion, 20)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, wServicePackMajor, 2)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wServicePackMajor, 2)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wServicePackMajor, 148)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, wServicePackMinor, 2)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wServicePackMinor, 2)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wServicePackMinor, 150)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, wSuiteMask, 2)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wSuiteMask, 2)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wSuiteMask, 152)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, wProductType, 1)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wProductType, 1)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wProductType, 154)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXA, wReserved, 1)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXA, wReserved, 1)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXA, wReserved, 155)
+}
+
+static void test_pack_OSVERSIONINFOEXW(void)
+{
+    /* OSVERSIONINFOEXW (pack 4) */
+    TEST_TYPE_SIZE   (OSVERSIONINFOEXW, 284)
+    TEST_TYPE_ALIGN  (OSVERSIONINFOEXW, 4)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwOSVersionInfoSize, 0)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, dwMajorVersion, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwMajorVersion, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwMajorVersion, 4)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, dwMinorVersion, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwMinorVersion, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwMinorVersion, 8)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, dwBuildNumber, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwBuildNumber, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwBuildNumber, 12)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, dwPlatformId, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, dwPlatformId, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, dwPlatformId, 16)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, szCSDVersion, 256)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, szCSDVersion, 2)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, szCSDVersion, 20)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, wServicePackMajor, 2)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wServicePackMajor, 2)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wServicePackMajor, 276)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, wServicePackMinor, 2)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wServicePackMinor, 2)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wServicePackMinor, 278)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, wSuiteMask, 2)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wSuiteMask, 2)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wSuiteMask, 280)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, wProductType, 1)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wProductType, 1)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wProductType, 282)
+    TEST_FIELD_SIZE  (OSVERSIONINFOEXW, wReserved, 1)
+    TEST_FIELD_ALIGN (OSVERSIONINFOEXW, wReserved, 1)
+    TEST_FIELD_OFFSET(OSVERSIONINFOEXW, wReserved, 283)
+}
+
+static void test_pack_OSVERSIONINFOW(void)
+{
+    /* OSVERSIONINFOW (pack 4) */
+    TEST_TYPE_SIZE   (OSVERSIONINFOW, 276)
+    TEST_TYPE_ALIGN  (OSVERSIONINFOW, 4)
+    TEST_FIELD_SIZE  (OSVERSIONINFOW, dwOSVersionInfoSize, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOW, dwOSVersionInfoSize, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOW, dwOSVersionInfoSize, 0)
+    TEST_FIELD_SIZE  (OSVERSIONINFOW, dwMajorVersion, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOW, dwMajorVersion, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOW, dwMajorVersion, 4)
+    TEST_FIELD_SIZE  (OSVERSIONINFOW, dwMinorVersion, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOW, dwMinorVersion, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOW, dwMinorVersion, 8)
+    TEST_FIELD_SIZE  (OSVERSIONINFOW, dwBuildNumber, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOW, dwBuildNumber, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOW, dwBuildNumber, 12)
+    TEST_FIELD_SIZE  (OSVERSIONINFOW, dwPlatformId, 4)
+    TEST_FIELD_ALIGN (OSVERSIONINFOW, dwPlatformId, 4)
+    TEST_FIELD_OFFSET(OSVERSIONINFOW, dwPlatformId, 16)
+    TEST_FIELD_SIZE  (OSVERSIONINFOW, szCSDVersion, 256)
+    TEST_FIELD_ALIGN (OSVERSIONINFOW, szCSDVersion, 2)
+    TEST_FIELD_OFFSET(OSVERSIONINFOW, szCSDVersion, 20)
+}
+
+static void test_pack_POSVERSIONINFOA(void)
+{
+    /* POSVERSIONINFOA */
+    TEST_TYPE_SIZE   (POSVERSIONINFOA, 4)
+    TEST_TYPE_ALIGN  (POSVERSIONINFOA, 4)
+    TEST_TARGET_SIZE (POSVERSIONINFOA, 148)
+    TEST_TARGET_ALIGN(POSVERSIONINFOA, 4)
+}
+
+static void test_pack_POSVERSIONINFOEXA(void)
+{
+    /* POSVERSIONINFOEXA */
+    TEST_TYPE_SIZE   (POSVERSIONINFOEXA, 4)
+    TEST_TYPE_ALIGN  (POSVERSIONINFOEXA, 4)
+    TEST_TARGET_SIZE (POSVERSIONINFOEXA, 156)
+    TEST_TARGET_ALIGN(POSVERSIONINFOEXA, 4)
+}
+
+static void test_pack_POSVERSIONINFOEXW(void)
+{
+    /* POSVERSIONINFOEXW */
+    TEST_TYPE_SIZE   (POSVERSIONINFOEXW, 4)
+    TEST_TYPE_ALIGN  (POSVERSIONINFOEXW, 4)
+    TEST_TARGET_SIZE (POSVERSIONINFOEXW, 284)
+    TEST_TARGET_ALIGN(POSVERSIONINFOEXW, 4)
+}
+
+static void test_pack_POSVERSIONINFOW(void)
+{
+    /* POSVERSIONINFOW */
+    TEST_TYPE_SIZE   (POSVERSIONINFOW, 4)
+    TEST_TYPE_ALIGN  (POSVERSIONINFOW, 4)
+    TEST_TARGET_SIZE (POSVERSIONINFOW, 276)
+    TEST_TARGET_ALIGN(POSVERSIONINFOW, 4)
+}
+
+static void test_pack_LPLONG(void)
+{
+    /* LPLONG */
+    TEST_TYPE_SIZE   (LPLONG, 4)
+    TEST_TYPE_ALIGN  (LPLONG, 4)
+}
+
+static void test_pack_LPVOID(void)
+{
+    /* LPVOID */
+    TEST_TYPE_SIZE   (LPVOID, 4)
+    TEST_TYPE_ALIGN  (LPVOID, 4)
+}
+
+static void test_pack_PHKEY(void)
+{
+    /* PHKEY */
+    TEST_TYPE_SIZE   (PHKEY, 4)
+    TEST_TYPE_ALIGN  (PHKEY, 4)
+}
+
+static void test_pack_ACTCTXA(void)
+{
+    /* ACTCTXA (pack 4) */
+    TEST_TYPE_SIZE   (ACTCTXA, 32)
+    TEST_TYPE_ALIGN  (ACTCTXA, 4)
+    TEST_FIELD_SIZE  (ACTCTXA, cbSize, 4)
+    TEST_FIELD_ALIGN (ACTCTXA, cbSize, 4)
+    TEST_FIELD_OFFSET(ACTCTXA, cbSize, 0)
+    TEST_FIELD_SIZE  (ACTCTXA, dwFlags, 4)
+    TEST_FIELD_ALIGN (ACTCTXA, dwFlags, 4)
+    TEST_FIELD_OFFSET(ACTCTXA, dwFlags, 4)
+    TEST_FIELD_SIZE  (ACTCTXA, lpSource, 4)
+    TEST_FIELD_ALIGN (ACTCTXA, lpSource, 4)
+    TEST_FIELD_OFFSET(ACTCTXA, lpSource, 8)
+    TEST_FIELD_SIZE  (ACTCTXA, wProcessorArchitecture, 2)
+    TEST_FIELD_ALIGN (ACTCTXA, wProcessorArchitecture, 2)
+    TEST_FIELD_OFFSET(ACTCTXA, wProcessorArchitecture, 12)
+    TEST_FIELD_SIZE  (ACTCTXA, wLangId, 2)
+    TEST_FIELD_ALIGN (ACTCTXA, wLangId, 2)
+    TEST_FIELD_OFFSET(ACTCTXA, wLangId, 14)
+    TEST_FIELD_SIZE  (ACTCTXA, lpAssemblyDirectory, 4)
+    TEST_FIELD_ALIGN (ACTCTXA, lpAssemblyDirectory, 4)
+    TEST_FIELD_OFFSET(ACTCTXA, lpAssemblyDirectory, 16)
+    TEST_FIELD_SIZE  (ACTCTXA, lpResourceName, 4)
+    TEST_FIELD_ALIGN (ACTCTXA, lpResourceName, 4)
+    TEST_FIELD_OFFSET(ACTCTXA, lpResourceName, 20)
+    TEST_FIELD_SIZE  (ACTCTXA, lpApplicationName, 4)
+    TEST_FIELD_ALIGN (ACTCTXA, lpApplicationName, 4)
+    TEST_FIELD_OFFSET(ACTCTXA, lpApplicationName, 24)
+    TEST_FIELD_SIZE  (ACTCTXA, hModule, 4)
+    TEST_FIELD_ALIGN (ACTCTXA, hModule, 4)
+    TEST_FIELD_OFFSET(ACTCTXA, hModule, 28)
+}
+
+static void test_pack_ACTCTXW(void)
+{
+    /* ACTCTXW (pack 4) */
+    TEST_TYPE_SIZE   (ACTCTXW, 32)
+    TEST_TYPE_ALIGN  (ACTCTXW, 4)
+    TEST_FIELD_SIZE  (ACTCTXW, cbSize, 4)
+    TEST_FIELD_ALIGN (ACTCTXW, cbSize, 4)
+    TEST_FIELD_OFFSET(ACTCTXW, cbSize, 0)
+    TEST_FIELD_SIZE  (ACTCTXW, dwFlags, 4)
+    TEST_FIELD_ALIGN (ACTCTXW, dwFlags, 4)
+    TEST_FIELD_OFFSET(ACTCTXW, dwFlags, 4)
+    TEST_FIELD_SIZE  (ACTCTXW, lpSource, 4)
+    TEST_FIELD_ALIGN (ACTCTXW, lpSource, 4)
+    TEST_FIELD_OFFSET(ACTCTXW, lpSource, 8)
+    TEST_FIELD_SIZE  (ACTCTXW, wProcessorArchitecture, 2)
+    TEST_FIELD_ALIGN (ACTCTXW, wProcessorArchitecture, 2)
+    TEST_FIELD_OFFSET(ACTCTXW, wProcessorArchitecture, 12)
+    TEST_FIELD_SIZE  (ACTCTXW, wLangId, 2)
+    TEST_FIELD_ALIGN (ACTCTXW, wLangId, 2)
+    TEST_FIELD_OFFSET(ACTCTXW, wLangId, 14)
+    TEST_FIELD_SIZE  (ACTCTXW, lpAssemblyDirectory, 4)
+    TEST_FIELD_ALIGN (ACTCTXW, lpAssemblyDirectory, 4)
+    TEST_FIELD_OFFSET(ACTCTXW, lpAssemblyDirectory, 16)
+    TEST_FIELD_SIZE  (ACTCTXW, lpResourceName, 4)
+    TEST_FIELD_ALIGN (ACTCTXW, lpResourceName, 4)
+    TEST_FIELD_OFFSET(ACTCTXW, lpResourceName, 20)
+    TEST_FIELD_SIZE  (ACTCTXW, lpApplicationName, 4)
+    TEST_FIELD_ALIGN (ACTCTXW, lpApplicationName, 4)
+    TEST_FIELD_OFFSET(ACTCTXW, lpApplicationName, 24)
+    TEST_FIELD_SIZE  (ACTCTXW, hModule, 4)
+    TEST_FIELD_ALIGN (ACTCTXW, hModule, 4)
+    TEST_FIELD_OFFSET(ACTCTXW, hModule, 28)
+}
+
+static void test_pack_ACTCTX_SECTION_KEYED_DATA(void)
+{
+    /* ACTCTX_SECTION_KEYED_DATA (pack 4) */
+    TEST_TYPE_SIZE   (ACTCTX_SECTION_KEYED_DATA, 64)
+    TEST_TYPE_ALIGN  (ACTCTX_SECTION_KEYED_DATA, 4)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, cbSize, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, cbSize, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, cbSize, 0)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, ulDataFormatVersion, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulDataFormatVersion, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulDataFormatVersion, 4)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, lpData, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, lpData, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, lpData, 8)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, ulLength, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulLength, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulLength, 12)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, lpSectionGlobalData, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, lpSectionGlobalData, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, lpSectionGlobalData, 16)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, ulSectionGlobalDataLength, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulSectionGlobalDataLength, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulSectionGlobalDataLength, 20)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, lpSectionBase, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, lpSectionBase, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, lpSectionBase, 24)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, ulSectionTotalLength, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulSectionTotalLength, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulSectionTotalLength, 28)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, hActCtx, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, hActCtx, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, hActCtx, 32)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulAssemblyRosterIndex, 36)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, ulFlags, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, ulFlags, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, ulFlags, 40)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA, AssemblyMetadata, 20)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA, AssemblyMetadata, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA, AssemblyMetadata, 44)
+}
+
+static void test_pack_ACTCTX_SECTION_KEYED_DATA_2600(void)
+{
+    /* ACTCTX_SECTION_KEYED_DATA_2600 (pack 4) */
+    TEST_TYPE_SIZE   (ACTCTX_SECTION_KEYED_DATA_2600, 40)
+    TEST_TYPE_ALIGN  (ACTCTX_SECTION_KEYED_DATA_2600, 4)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, cbSize, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, cbSize, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, cbSize, 0)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, ulDataFormatVersion, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulDataFormatVersion, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulDataFormatVersion, 4)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, lpData, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, lpData, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, lpData, 8)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, ulLength, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulLength, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulLength, 12)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, lpSectionGlobalData, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, lpSectionGlobalData, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, lpSectionGlobalData, 16)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, ulSectionGlobalDataLength, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulSectionGlobalDataLength, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulSectionGlobalDataLength, 20)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, lpSectionBase, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, lpSectionBase, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, lpSectionBase, 24)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, ulSectionTotalLength, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulSectionTotalLength, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulSectionTotalLength, 28)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, hActCtx, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, hActCtx, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, hActCtx, 32)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_2600, ulAssemblyRosterIndex, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_2600, ulAssemblyRosterIndex, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_2600, ulAssemblyRosterIndex, 36)
+}
+
+static void test_pack_ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(void)
+{
+    /* ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA (pack 4) */
+    TEST_TYPE_SIZE   (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 20)
+    TEST_TYPE_ALIGN  (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpInformation, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpInformation, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpInformation, 0)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionBase, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionBase, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionBase, 4)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionLength, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionLength, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionLength, 8)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionGlobalDataBase, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionGlobalDataBase, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, lpSectionGlobalDataBase, 12)
+    TEST_FIELD_SIZE  (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionGlobalDataLength, 4)
+    TEST_FIELD_ALIGN (ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionGlobalDataLength, 4)
+    TEST_FIELD_OFFSET(ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, ulSectionGlobalDataLength, 16)
+}
+
+static void test_pack_ACTIVATION_CONTEXT_BASIC_INFORMATION(void)
+{
+    /* ACTIVATION_CONTEXT_BASIC_INFORMATION (pack 4) */
+    TEST_TYPE_SIZE   (ACTIVATION_CONTEXT_BASIC_INFORMATION, 8)
+    TEST_TYPE_ALIGN  (ACTIVATION_CONTEXT_BASIC_INFORMATION, 4)
+    TEST_FIELD_SIZE  (ACTIVATION_CONTEXT_BASIC_INFORMATION, hActCtx, 4)
+    TEST_FIELD_ALIGN (ACTIVATION_CONTEXT_BASIC_INFORMATION, hActCtx, 4)
+    TEST_FIELD_OFFSET(ACTIVATION_CONTEXT_BASIC_INFORMATION, hActCtx, 0)
+    TEST_FIELD_SIZE  (ACTIVATION_CONTEXT_BASIC_INFORMATION, dwFlags, 4)
+    TEST_FIELD_ALIGN (ACTIVATION_CONTEXT_BASIC_INFORMATION, dwFlags, 4)
+    TEST_FIELD_OFFSET(ACTIVATION_CONTEXT_BASIC_INFORMATION, dwFlags, 4)
+}
+
+static void test_pack_BY_HANDLE_FILE_INFORMATION(void)
+{
+    /* BY_HANDLE_FILE_INFORMATION (pack 4) */
+    TEST_TYPE_SIZE   (BY_HANDLE_FILE_INFORMATION, 52)
+    TEST_TYPE_ALIGN  (BY_HANDLE_FILE_INFORMATION, 4)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, dwFileAttributes, 4)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, dwFileAttributes, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, dwFileAttributes, 0)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, ftCreationTime, 8)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, ftCreationTime, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, ftCreationTime, 4)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, ftLastAccessTime, 8)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, ftLastAccessTime, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, ftLastAccessTime, 12)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, ftLastWriteTime, 8)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, ftLastWriteTime, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, ftLastWriteTime, 20)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, dwVolumeSerialNumber, 4)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, dwVolumeSerialNumber, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, dwVolumeSerialNumber, 28)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, nFileSizeHigh, 4)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nFileSizeHigh, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nFileSizeHigh, 32)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, nFileSizeLow, 4)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nFileSizeLow, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nFileSizeLow, 36)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, nNumberOfLinks, 4)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nNumberOfLinks, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nNumberOfLinks, 40)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, nFileIndexHigh, 4)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nFileIndexHigh, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nFileIndexHigh, 44)
+    TEST_FIELD_SIZE  (BY_HANDLE_FILE_INFORMATION, nFileIndexLow, 4)
+    TEST_FIELD_ALIGN (BY_HANDLE_FILE_INFORMATION, nFileIndexLow, 4)
+    TEST_FIELD_OFFSET(BY_HANDLE_FILE_INFORMATION, nFileIndexLow, 48)
+}
+
+static void test_pack_COMMCONFIG(void)
+{
+    /* COMMCONFIG (pack 4) */
+    TEST_TYPE_SIZE   (COMMCONFIG, 52)
+    TEST_TYPE_ALIGN  (COMMCONFIG, 4)
+    TEST_FIELD_SIZE  (COMMCONFIG, dwSize, 4)
+    TEST_FIELD_ALIGN (COMMCONFIG, dwSize, 4)
+    TEST_FIELD_OFFSET(COMMCONFIG, dwSize, 0)
+    TEST_FIELD_SIZE  (COMMCONFIG, wVersion, 2)
+    TEST_FIELD_ALIGN (COMMCONFIG, wVersion, 2)
+    TEST_FIELD_OFFSET(COMMCONFIG, wVersion, 4)
+    TEST_FIELD_SIZE  (COMMCONFIG, wReserved, 2)
+    TEST_FIELD_ALIGN (COMMCONFIG, wReserved, 2)
+    TEST_FIELD_OFFSET(COMMCONFIG, wReserved, 6)
+    TEST_FIELD_SIZE  (COMMCONFIG, dcb, 28)
+    TEST_FIELD_ALIGN (COMMCONFIG, dcb, 4)
+    TEST_FIELD_OFFSET(COMMCONFIG, dcb, 8)
+    TEST_FIELD_SIZE  (COMMCONFIG, dwProviderSubType, 4)
+    TEST_FIELD_ALIGN (COMMCONFIG, dwProviderSubType, 4)
+    TEST_FIELD_OFFSET(COMMCONFIG, dwProviderSubType, 36)
+    TEST_FIELD_SIZE  (COMMCONFIG, dwProviderOffset, 4)
+    TEST_FIELD_ALIGN (COMMCONFIG, dwProviderOffset, 4)
+    TEST_FIELD_OFFSET(COMMCONFIG, dwProviderOffset, 40)
+    TEST_FIELD_SIZE  (COMMCONFIG, dwProviderSize, 4)
+    TEST_FIELD_ALIGN (COMMCONFIG, dwProviderSize, 4)
+    TEST_FIELD_OFFSET(COMMCONFIG, dwProviderSize, 44)
+    TEST_FIELD_SIZE  (COMMCONFIG, wcProviderData, 4)
+    TEST_FIELD_ALIGN (COMMCONFIG, wcProviderData, 4)
+    TEST_FIELD_OFFSET(COMMCONFIG, wcProviderData, 48)
+}
+
+static void test_pack_COMMPROP(void)
+{
+    /* COMMPROP (pack 4) */
+    TEST_TYPE_SIZE   (COMMPROP, 64)
+    TEST_TYPE_ALIGN  (COMMPROP, 4)
+    TEST_FIELD_SIZE  (COMMPROP, wPacketLength, 2)
+    TEST_FIELD_ALIGN (COMMPROP, wPacketLength, 2)
+    TEST_FIELD_OFFSET(COMMPROP, wPacketLength, 0)
+    TEST_FIELD_SIZE  (COMMPROP, wPacketVersion, 2)
+    TEST_FIELD_ALIGN (COMMPROP, wPacketVersion, 2)
+    TEST_FIELD_OFFSET(COMMPROP, wPacketVersion, 2)
+    TEST_FIELD_SIZE  (COMMPROP, dwServiceMask, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwServiceMask, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwServiceMask, 4)
+    TEST_FIELD_SIZE  (COMMPROP, dwReserved1, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwReserved1, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwReserved1, 8)
+    TEST_FIELD_SIZE  (COMMPROP, dwMaxTxQueue, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwMaxTxQueue, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwMaxTxQueue, 12)
+    TEST_FIELD_SIZE  (COMMPROP, dwMaxRxQueue, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwMaxRxQueue, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwMaxRxQueue, 16)
+    TEST_FIELD_SIZE  (COMMPROP, dwMaxBaud, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwMaxBaud, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwMaxBaud, 20)
+    TEST_FIELD_SIZE  (COMMPROP, dwProvSubType, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwProvSubType, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwProvSubType, 24)
+    TEST_FIELD_SIZE  (COMMPROP, dwProvCapabilities, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwProvCapabilities, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwProvCapabilities, 28)
+    TEST_FIELD_SIZE  (COMMPROP, dwSettableParams, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwSettableParams, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwSettableParams, 32)
+    TEST_FIELD_SIZE  (COMMPROP, dwSettableBaud, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwSettableBaud, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwSettableBaud, 36)
+    TEST_FIELD_SIZE  (COMMPROP, wSettableData, 2)
+    TEST_FIELD_ALIGN (COMMPROP, wSettableData, 2)
+    TEST_FIELD_OFFSET(COMMPROP, wSettableData, 40)
+    TEST_FIELD_SIZE  (COMMPROP, wSettableStopParity, 2)
+    TEST_FIELD_ALIGN (COMMPROP, wSettableStopParity, 2)
+    TEST_FIELD_OFFSET(COMMPROP, wSettableStopParity, 42)
+    TEST_FIELD_SIZE  (COMMPROP, dwCurrentTxQueue, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwCurrentTxQueue, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwCurrentTxQueue, 44)
+    TEST_FIELD_SIZE  (COMMPROP, dwCurrentRxQueue, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwCurrentRxQueue, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwCurrentRxQueue, 48)
+    TEST_FIELD_SIZE  (COMMPROP, dwProvSpec1, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwProvSpec1, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwProvSpec1, 52)
+    TEST_FIELD_SIZE  (COMMPROP, dwProvSpec2, 4)
+    TEST_FIELD_ALIGN (COMMPROP, dwProvSpec2, 4)
+    TEST_FIELD_OFFSET(COMMPROP, dwProvSpec2, 56)
+    TEST_FIELD_SIZE  (COMMPROP, wcProvChar, 2)
+    TEST_FIELD_ALIGN (COMMPROP, wcProvChar, 2)
+    TEST_FIELD_OFFSET(COMMPROP, wcProvChar, 60)
+}
+
+static void test_pack_COMMTIMEOUTS(void)
+{
+    /* COMMTIMEOUTS (pack 4) */
+    TEST_TYPE_SIZE   (COMMTIMEOUTS, 20)
+    TEST_TYPE_ALIGN  (COMMTIMEOUTS, 4)
+    TEST_FIELD_SIZE  (COMMTIMEOUTS, ReadIntervalTimeout, 4)
+    TEST_FIELD_ALIGN (COMMTIMEOUTS, ReadIntervalTimeout, 4)
+    TEST_FIELD_OFFSET(COMMTIMEOUTS, ReadIntervalTimeout, 0)
+    TEST_FIELD_SIZE  (COMMTIMEOUTS, ReadTotalTimeoutMultiplier, 4)
+    TEST_FIELD_ALIGN (COMMTIMEOUTS, ReadTotalTimeoutMultiplier, 4)
+    TEST_FIELD_OFFSET(COMMTIMEOUTS, ReadTotalTimeoutMultiplier, 4)
+    TEST_FIELD_SIZE  (COMMTIMEOUTS, ReadTotalTimeoutConstant, 4)
+    TEST_FIELD_ALIGN (COMMTIMEOUTS, ReadTotalTimeoutConstant, 4)
+    TEST_FIELD_OFFSET(COMMTIMEOUTS, ReadTotalTimeoutConstant, 8)
+    TEST_FIELD_SIZE  (COMMTIMEOUTS, WriteTotalTimeoutMultiplier, 4)
+    TEST_FIELD_ALIGN (COMMTIMEOUTS, WriteTotalTimeoutMultiplier, 4)
+    TEST_FIELD_OFFSET(COMMTIMEOUTS, WriteTotalTimeoutMultiplier, 12)
+    TEST_FIELD_SIZE  (COMMTIMEOUTS, WriteTotalTimeoutConstant, 4)
+    TEST_FIELD_ALIGN (COMMTIMEOUTS, WriteTotalTimeoutConstant, 4)
+    TEST_FIELD_OFFSET(COMMTIMEOUTS, WriteTotalTimeoutConstant, 16)
+}
+
+static void test_pack_COMSTAT(void)
+{
+    /* COMSTAT (pack 4) */
+    TEST_TYPE_SIZE   (COMSTAT, 12)
+    TEST_TYPE_ALIGN  (COMSTAT, 4)
+    TEST_FIELD_SIZE  (COMSTAT, cbInQue, 4)
+    TEST_FIELD_ALIGN (COMSTAT, cbInQue, 4)
+    TEST_FIELD_OFFSET(COMSTAT, cbInQue, 4)
+    TEST_FIELD_SIZE  (COMSTAT, cbOutQue, 4)
+    TEST_FIELD_ALIGN (COMSTAT, cbOutQue, 4)
+    TEST_FIELD_OFFSET(COMSTAT, cbOutQue, 8)
+}
+
+static void test_pack_CREATE_PROCESS_DEBUG_INFO(void)
+{
+    /* CREATE_PROCESS_DEBUG_INFO (pack 4) */
+    TEST_TYPE_SIZE   (CREATE_PROCESS_DEBUG_INFO, 40)
+    TEST_TYPE_ALIGN  (CREATE_PROCESS_DEBUG_INFO, 4)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, hFile, 4)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, hFile, 4)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, hFile, 0)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, hProcess, 4)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, hProcess, 4)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, hProcess, 4)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, hThread, 4)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, hThread, 4)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, hThread, 8)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, lpBaseOfImage, 4)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, lpBaseOfImage, 4)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, lpBaseOfImage, 12)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, dwDebugInfoFileOffset, 4)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, dwDebugInfoFileOffset, 4)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, dwDebugInfoFileOffset, 16)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, nDebugInfoSize, 4)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, nDebugInfoSize, 4)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, nDebugInfoSize, 20)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, lpThreadLocalBase, 4)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, lpThreadLocalBase, 4)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, lpThreadLocalBase, 24)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, lpStartAddress, 4)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, lpStartAddress, 4)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, lpStartAddress, 28)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, lpImageName, 4)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, lpImageName, 4)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, lpImageName, 32)
+    TEST_FIELD_SIZE  (CREATE_PROCESS_DEBUG_INFO, fUnicode, 2)
+    TEST_FIELD_ALIGN (CREATE_PROCESS_DEBUG_INFO, fUnicode, 2)
+    TEST_FIELD_OFFSET(CREATE_PROCESS_DEBUG_INFO, fUnicode, 36)
+}
+
+static void test_pack_CREATE_THREAD_DEBUG_INFO(void)
+{
+    /* CREATE_THREAD_DEBUG_INFO (pack 4) */
+    TEST_TYPE_SIZE   (CREATE_THREAD_DEBUG_INFO, 12)
+    TEST_TYPE_ALIGN  (CREATE_THREAD_DEBUG_INFO, 4)
+    TEST_FIELD_SIZE  (CREATE_THREAD_DEBUG_INFO, hThread, 4)
+    TEST_FIELD_ALIGN (CREATE_THREAD_DEBUG_INFO, hThread, 4)
+    TEST_FIELD_OFFSET(CREATE_THREAD_DEBUG_INFO, hThread, 0)
+    TEST_FIELD_SIZE  (CREATE_THREAD_DEBUG_INFO, lpThreadLocalBase, 4)
+    TEST_FIELD_ALIGN (CREATE_THREAD_DEBUG_INFO, lpThreadLocalBase, 4)
+    TEST_FIELD_OFFSET(CREATE_THREAD_DEBUG_INFO, lpThreadLocalBase, 4)
+    TEST_FIELD_SIZE  (CREATE_THREAD_DEBUG_INFO, lpStartAddress, 4)
+    TEST_FIELD_ALIGN (CREATE_THREAD_DEBUG_INFO, lpStartAddress, 4)
+    TEST_FIELD_OFFSET(CREATE_THREAD_DEBUG_INFO, lpStartAddress, 8)
+}
+
+static void test_pack_CRITICAL_SECTION(void)
+{
+    /* CRITICAL_SECTION */
+    TEST_TYPE_SIZE   (CRITICAL_SECTION, 24)
+    TEST_TYPE_ALIGN  (CRITICAL_SECTION, 4)
+}
+
+static void test_pack_CRITICAL_SECTION_DEBUG(void)
+{
+    /* CRITICAL_SECTION_DEBUG */
+}
+
+static void test_pack_DCB(void)
+{
+    /* DCB (pack 4) */
+    TEST_TYPE_SIZE   (DCB, 28)
+    TEST_TYPE_ALIGN  (DCB, 4)
+    TEST_FIELD_SIZE  (DCB, DCBlength, 4)
+    TEST_FIELD_ALIGN (DCB, DCBlength, 4)
+    TEST_FIELD_OFFSET(DCB, DCBlength, 0)
+    TEST_FIELD_SIZE  (DCB, BaudRate, 4)
+    TEST_FIELD_ALIGN (DCB, BaudRate, 4)
+    TEST_FIELD_OFFSET(DCB, BaudRate, 4)
+    TEST_FIELD_SIZE  (DCB, wReserved, 2)
+    TEST_FIELD_ALIGN (DCB, wReserved, 2)
+    TEST_FIELD_OFFSET(DCB, wReserved, 12)
+    TEST_FIELD_SIZE  (DCB, XonLim, 2)
+    TEST_FIELD_ALIGN (DCB, XonLim, 2)
+    TEST_FIELD_OFFSET(DCB, XonLim, 14)
+    TEST_FIELD_SIZE  (DCB, XoffLim, 2)
+    TEST_FIELD_ALIGN (DCB, XoffLim, 2)
+    TEST_FIELD_OFFSET(DCB, XoffLim, 16)
+    TEST_FIELD_SIZE  (DCB, ByteSize, 1)
+    TEST_FIELD_ALIGN (DCB, ByteSize, 1)
+    TEST_FIELD_OFFSET(DCB, ByteSize, 18)
+    TEST_FIELD_SIZE  (DCB, Parity, 1)
+    TEST_FIELD_ALIGN (DCB, Parity, 1)
+    TEST_FIELD_OFFSET(DCB, Parity, 19)
+    TEST_FIELD_SIZE  (DCB, StopBits, 1)
+    TEST_FIELD_ALIGN (DCB, StopBits, 1)
+    TEST_FIELD_OFFSET(DCB, StopBits, 20)
+    TEST_FIELD_SIZE  (DCB, XonChar, 1)
+    TEST_FIELD_ALIGN (DCB, XonChar, 1)
+    TEST_FIELD_OFFSET(DCB, XonChar, 21)
+    TEST_FIELD_SIZE  (DCB, XoffChar, 1)
+    TEST_FIELD_ALIGN (DCB, XoffChar, 1)
+    TEST_FIELD_OFFSET(DCB, XoffChar, 22)
+    TEST_FIELD_SIZE  (DCB, ErrorChar, 1)
+    TEST_FIELD_ALIGN (DCB, ErrorChar, 1)
+    TEST_FIELD_OFFSET(DCB, ErrorChar, 23)
+    TEST_FIELD_SIZE  (DCB, EofChar, 1)
+    TEST_FIELD_ALIGN (DCB, EofChar, 1)
+    TEST_FIELD_OFFSET(DCB, EofChar, 24)
+    TEST_FIELD_SIZE  (DCB, EvtChar, 1)
+    TEST_FIELD_ALIGN (DCB, EvtChar, 1)
+    TEST_FIELD_OFFSET(DCB, EvtChar, 25)
+    TEST_FIELD_SIZE  (DCB, wReserved1, 2)
+    TEST_FIELD_ALIGN (DCB, wReserved1, 2)
+    TEST_FIELD_OFFSET(DCB, wReserved1, 26)
+}
+
+static void test_pack_DEBUG_EVENT(void)
+{
+    /* DEBUG_EVENT (pack 4) */
+    TEST_FIELD_SIZE  (DEBUG_EVENT, dwDebugEventCode, 4)
+    TEST_FIELD_ALIGN (DEBUG_EVENT, dwDebugEventCode, 4)
+    TEST_FIELD_OFFSET(DEBUG_EVENT, dwDebugEventCode, 0)
+    TEST_FIELD_SIZE  (DEBUG_EVENT, dwProcessId, 4)
+    TEST_FIELD_ALIGN (DEBUG_EVENT, dwProcessId, 4)
+    TEST_FIELD_OFFSET(DEBUG_EVENT, dwProcessId, 4)
+    TEST_FIELD_SIZE  (DEBUG_EVENT, dwThreadId, 4)
+    TEST_FIELD_ALIGN (DEBUG_EVENT, dwThreadId, 4)
+    TEST_FIELD_OFFSET(DEBUG_EVENT, dwThreadId, 8)
+}
+
+static void test_pack_ENUMRESLANGPROCA(void)
+{
+    /* ENUMRESLANGPROCA */
+    TEST_TYPE_SIZE   (ENUMRESLANGPROCA, 4)
+    TEST_TYPE_ALIGN  (ENUMRESLANGPROCA, 4)
+}
+
+static void test_pack_ENUMRESLANGPROCW(void)
+{
+    /* ENUMRESLANGPROCW */
+    TEST_TYPE_SIZE   (ENUMRESLANGPROCW, 4)
+    TEST_TYPE_ALIGN  (ENUMRESLANGPROCW, 4)
+}
+
+static void test_pack_ENUMRESNAMEPROCA(void)
+{
+    /* ENUMRESNAMEPROCA */
+    TEST_TYPE_SIZE   (ENUMRESNAMEPROCA, 4)
+    TEST_TYPE_ALIGN  (ENUMRESNAMEPROCA, 4)
+}
+
+static void test_pack_ENUMRESNAMEPROCW(void)
+{
+    /* ENUMRESNAMEPROCW */
+    TEST_TYPE_SIZE   (ENUMRESNAMEPROCW, 4)
+    TEST_TYPE_ALIGN  (ENUMRESNAMEPROCW, 4)
+}
+
+static void test_pack_ENUMRESTYPEPROCA(void)
+{
+    /* ENUMRESTYPEPROCA */
+    TEST_TYPE_SIZE   (ENUMRESTYPEPROCA, 4)
+    TEST_TYPE_ALIGN  (ENUMRESTYPEPROCA, 4)
+}
+
+static void test_pack_ENUMRESTYPEPROCW(void)
+{
+    /* ENUMRESTYPEPROCW */
+    TEST_TYPE_SIZE   (ENUMRESTYPEPROCW, 4)
+    TEST_TYPE_ALIGN  (ENUMRESTYPEPROCW, 4)
+}
+
+static void test_pack_EXCEPTION_DEBUG_INFO(void)
+{
+    /* EXCEPTION_DEBUG_INFO (pack 4) */
+    TEST_TYPE_SIZE   (EXCEPTION_DEBUG_INFO, 84)
+    TEST_TYPE_ALIGN  (EXCEPTION_DEBUG_INFO, 4)
+    TEST_FIELD_SIZE  (EXCEPTION_DEBUG_INFO, ExceptionRecord, 80)
+    TEST_FIELD_ALIGN (EXCEPTION_DEBUG_INFO, ExceptionRecord, 4)
+    TEST_FIELD_OFFSET(EXCEPTION_DEBUG_INFO, ExceptionRecord, 0)
+    TEST_FIELD_SIZE  (EXCEPTION_DEBUG_INFO, dwFirstChance, 4)
+    TEST_FIELD_ALIGN (EXCEPTION_DEBUG_INFO, dwFirstChance, 4)
+    TEST_FIELD_OFFSET(EXCEPTION_DEBUG_INFO, dwFirstChance, 80)
+}
+
+static void test_pack_EXIT_PROCESS_DEBUG_INFO(void)
+{
+    /* EXIT_PROCESS_DEBUG_INFO (pack 4) */
+    TEST_TYPE_SIZE   (EXIT_PROCESS_DEBUG_INFO, 4)
+    TEST_TYPE_ALIGN  (EXIT_PROCESS_DEBUG_INFO, 4)
+    TEST_FIELD_SIZE  (EXIT_PROCESS_DEBUG_INFO, dwExitCode, 4)
+    TEST_FIELD_ALIGN (EXIT_PROCESS_DEBUG_INFO, dwExitCode, 4)
+    TEST_FIELD_OFFSET(EXIT_PROCESS_DEBUG_INFO, dwExitCode, 0)
+}
+
+static void test_pack_EXIT_THREAD_DEBUG_INFO(void)
+{
+    /* EXIT_THREAD_DEBUG_INFO (pack 4) */
+    TEST_TYPE_SIZE   (EXIT_THREAD_DEBUG_INFO, 4)
+    TEST_TYPE_ALIGN  (EXIT_THREAD_DEBUG_INFO, 4)
+    TEST_FIELD_SIZE  (EXIT_THREAD_DEBUG_INFO, dwExitCode, 4)
+    TEST_FIELD_ALIGN (EXIT_THREAD_DEBUG_INFO, dwExitCode, 4)
+    TEST_FIELD_OFFSET(EXIT_THREAD_DEBUG_INFO, dwExitCode, 0)
+}
+
+static void test_pack_HW_PROFILE_INFOA(void)
+{
+    /* HW_PROFILE_INFOA (pack 4) */
+    TEST_TYPE_SIZE   (HW_PROFILE_INFOA, 124)
+    TEST_TYPE_ALIGN  (HW_PROFILE_INFOA, 4)
+    TEST_FIELD_SIZE  (HW_PROFILE_INFOA, dwDockInfo, 4)
+    TEST_FIELD_ALIGN (HW_PROFILE_INFOA, dwDockInfo, 4)
+    TEST_FIELD_OFFSET(HW_PROFILE_INFOA, dwDockInfo, 0)
+    TEST_FIELD_SIZE  (HW_PROFILE_INFOA, szHwProfileGuid, 39)
+    TEST_FIELD_ALIGN (HW_PROFILE_INFOA, szHwProfileGuid, 1)
+    TEST_FIELD_OFFSET(HW_PROFILE_INFOA, szHwProfileGuid, 4)
+    TEST_FIELD_SIZE  (HW_PROFILE_INFOA, szHwProfileName, 80)
+    TEST_FIELD_ALIGN (HW_PROFILE_INFOA, szHwProfileName, 1)
+    TEST_FIELD_OFFSET(HW_PROFILE_INFOA, szHwProfileName, 43)
+}
+
+static void test_pack_HW_PROFILE_INFOW(void)
+{
+    /* HW_PROFILE_INFOW (pack 4) */
+    TEST_TYPE_SIZE   (HW_PROFILE_INFOW, 244)
+    TEST_TYPE_ALIGN  (HW_PROFILE_INFOW, 4)
+    TEST_FIELD_SIZE  (HW_PROFILE_INFOW, dwDockInfo, 4)
+    TEST_FIELD_ALIGN (HW_PROFILE_INFOW, dwDockInfo, 4)
+    TEST_FIELD_OFFSET(HW_PROFILE_INFOW, dwDockInfo, 0)
+    TEST_FIELD_SIZE  (HW_PROFILE_INFOW, szHwProfileGuid, 78)
+    TEST_FIELD_ALIGN (HW_PROFILE_INFOW, szHwProfileGuid, 2)
+    TEST_FIELD_OFFSET(HW_PROFILE_INFOW, szHwProfileGuid, 4)
+    TEST_FIELD_SIZE  (HW_PROFILE_INFOW, szHwProfileName, 160)
+    TEST_FIELD_ALIGN (HW_PROFILE_INFOW, szHwProfileName, 2)
+    TEST_FIELD_OFFSET(HW_PROFILE_INFOW, szHwProfileName, 82)
+}
+
+static void test_pack_LOAD_DLL_DEBUG_INFO(void)
+{
+    /* LOAD_DLL_DEBUG_INFO (pack 4) */
+    TEST_TYPE_SIZE   (LOAD_DLL_DEBUG_INFO, 24)
+    TEST_TYPE_ALIGN  (LOAD_DLL_DEBUG_INFO, 4)
+    TEST_FIELD_SIZE  (LOAD_DLL_DEBUG_INFO, hFile, 4)
+    TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, hFile, 4)
+    TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, hFile, 0)
+    TEST_FIELD_SIZE  (LOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4)
+    TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4)
+    TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4)
+    TEST_FIELD_SIZE  (LOAD_DLL_DEBUG_INFO, dwDebugInfoFileOffset, 4)
+    TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, dwDebugInfoFileOffset, 4)
+    TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, dwDebugInfoFileOffset, 8)
+    TEST_FIELD_SIZE  (LOAD_DLL_DEBUG_INFO, nDebugInfoSize, 4)
+    TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, nDebugInfoSize, 4)
+    TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, nDebugInfoSize, 12)
+    TEST_FIELD_SIZE  (LOAD_DLL_DEBUG_INFO, lpImageName, 4)
+    TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, lpImageName, 4)
+    TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, lpImageName, 16)
+    TEST_FIELD_SIZE  (LOAD_DLL_DEBUG_INFO, fUnicode, 2)
+    TEST_FIELD_ALIGN (LOAD_DLL_DEBUG_INFO, fUnicode, 2)
+    TEST_FIELD_OFFSET(LOAD_DLL_DEBUG_INFO, fUnicode, 20)
+}
+
+static void test_pack_LPBY_HANDLE_FILE_INFORMATION(void)
+{
+    /* LPBY_HANDLE_FILE_INFORMATION */
+    TEST_TYPE_SIZE   (LPBY_HANDLE_FILE_INFORMATION, 4)
+    TEST_TYPE_ALIGN  (LPBY_HANDLE_FILE_INFORMATION, 4)
+    TEST_TARGET_SIZE (LPBY_HANDLE_FILE_INFORMATION, 52)
+    TEST_TARGET_ALIGN(LPBY_HANDLE_FILE_INFORMATION, 4)
+}
+
+static void test_pack_LPCOMMCONFIG(void)
+{
+    /* LPCOMMCONFIG */
+    TEST_TYPE_SIZE   (LPCOMMCONFIG, 4)
+    TEST_TYPE_ALIGN  (LPCOMMCONFIG, 4)
+    TEST_TARGET_SIZE (LPCOMMCONFIG, 52)
+    TEST_TARGET_ALIGN(LPCOMMCONFIG, 4)
+}
+
+static void test_pack_LPCOMMPROP(void)
+{
+    /* LPCOMMPROP */
+    TEST_TYPE_SIZE   (LPCOMMPROP, 4)
+    TEST_TYPE_ALIGN  (LPCOMMPROP, 4)
+    TEST_TARGET_SIZE (LPCOMMPROP, 64)
+    TEST_TARGET_ALIGN(LPCOMMPROP, 4)
+}
+
+static void test_pack_LPCOMMTIMEOUTS(void)
+{
+    /* LPCOMMTIMEOUTS */
+    TEST_TYPE_SIZE   (LPCOMMTIMEOUTS, 4)
+    TEST_TYPE_ALIGN  (LPCOMMTIMEOUTS, 4)
+    TEST_TARGET_SIZE (LPCOMMTIMEOUTS, 20)
+    TEST_TARGET_ALIGN(LPCOMMTIMEOUTS, 4)
+}
+
+static void test_pack_LPCOMSTAT(void)
+{
+    /* LPCOMSTAT */
+    TEST_TYPE_SIZE   (LPCOMSTAT, 4)
+    TEST_TYPE_ALIGN  (LPCOMSTAT, 4)
+    TEST_TARGET_SIZE (LPCOMSTAT, 12)
+    TEST_TARGET_ALIGN(LPCOMSTAT, 4)
+}
+
+static void test_pack_LPCRITICAL_SECTION(void)
+{
+    /* LPCRITICAL_SECTION */
+    TEST_TYPE_SIZE   (LPCRITICAL_SECTION, 4)
+    TEST_TYPE_ALIGN  (LPCRITICAL_SECTION, 4)
+}
+
+static void test_pack_LPCRITICAL_SECTION_DEBUG(void)
+{
+    /* LPCRITICAL_SECTION_DEBUG */
+    TEST_TYPE_SIZE   (LPCRITICAL_SECTION_DEBUG, 4)
+    TEST_TYPE_ALIGN  (LPCRITICAL_SECTION_DEBUG, 4)
+}
+
+static void test_pack_LPDCB(void)
+{
+    /* LPDCB */
+    TEST_TYPE_SIZE   (LPDCB, 4)
+    TEST_TYPE_ALIGN  (LPDCB, 4)
+    TEST_TARGET_SIZE (LPDCB, 28)
+    TEST_TARGET_ALIGN(LPDCB, 4)
+}
+
+static void test_pack_LPDEBUG_EVENT(void)
+{
+    /* LPDEBUG_EVENT */
+    TEST_TYPE_SIZE   (LPDEBUG_EVENT, 4)
+    TEST_TYPE_ALIGN  (LPDEBUG_EVENT, 4)
+}
+
+static void test_pack_LPEXCEPTION_POINTERS(void)
+{
+    /* LPEXCEPTION_POINTERS */
+    TEST_TYPE_SIZE   (LPEXCEPTION_POINTERS, 4)
+    TEST_TYPE_ALIGN  (LPEXCEPTION_POINTERS, 4)
+}
+
+static void test_pack_LPEXCEPTION_RECORD(void)
+{
+    /* LPEXCEPTION_RECORD */
+    TEST_TYPE_SIZE   (LPEXCEPTION_RECORD, 4)
+    TEST_TYPE_ALIGN  (LPEXCEPTION_RECORD, 4)
+}
+
+static void test_pack_LPFIBER_START_ROUTINE(void)
+{
+    /* LPFIBER_START_ROUTINE */
+    TEST_TYPE_SIZE   (LPFIBER_START_ROUTINE, 4)
+    TEST_TYPE_ALIGN  (LPFIBER_START_ROUTINE, 4)
+}
+
+static void test_pack_LPHW_PROFILE_INFOA(void)
+{
+    /* LPHW_PROFILE_INFOA */
+    TEST_TYPE_SIZE   (LPHW_PROFILE_INFOA, 4)
+    TEST_TYPE_ALIGN  (LPHW_PROFILE_INFOA, 4)
+    TEST_TARGET_SIZE (LPHW_PROFILE_INFOA, 124)
+    TEST_TARGET_ALIGN(LPHW_PROFILE_INFOA, 4)
+}
+
+static void test_pack_LPHW_PROFILE_INFOW(void)
+{
+    /* LPHW_PROFILE_INFOW */
+    TEST_TYPE_SIZE   (LPHW_PROFILE_INFOW, 4)
+    TEST_TYPE_ALIGN  (LPHW_PROFILE_INFOW, 4)
+    TEST_TARGET_SIZE (LPHW_PROFILE_INFOW, 244)
+    TEST_TARGET_ALIGN(LPHW_PROFILE_INFOW, 4)
+}
+
+static void test_pack_LPMEMORYSTATUS(void)
+{
+    /* LPMEMORYSTATUS */
+    TEST_TYPE_SIZE   (LPMEMORYSTATUS, 4)
+    TEST_TYPE_ALIGN  (LPMEMORYSTATUS, 4)
+    TEST_TARGET_SIZE (LPMEMORYSTATUS, 32)
+    TEST_TARGET_ALIGN(LPMEMORYSTATUS, 4)
+}
+
+static void test_pack_LPMEMORYSTATUSEX(void)
+{
+    /* LPMEMORYSTATUSEX */
+    TEST_TYPE_SIZE   (LPMEMORYSTATUSEX, 4)
+    TEST_TYPE_ALIGN  (LPMEMORYSTATUSEX, 4)
+    TEST_TARGET_SIZE (LPMEMORYSTATUSEX, 64)
+    TEST_TARGET_ALIGN(LPMEMORYSTATUSEX, 8)
+}
+
+static void test_pack_LPOFSTRUCT(void)
+{
+    /* LPOFSTRUCT */
+    TEST_TYPE_SIZE   (LPOFSTRUCT, 4)
+    TEST_TYPE_ALIGN  (LPOFSTRUCT, 4)
+    TEST_TARGET_SIZE (LPOFSTRUCT, 136)
+    TEST_TARGET_ALIGN(LPOFSTRUCT, 2)
+}
+
+static void test_pack_LPOVERLAPPED(void)
+{
+    /* LPOVERLAPPED */
+    TEST_TYPE_SIZE   (LPOVERLAPPED, 4)
+    TEST_TYPE_ALIGN  (LPOVERLAPPED, 4)
+}
+
+static void test_pack_LPOVERLAPPED_COMPLETION_ROUTINE(void)
+{
+    /* LPOVERLAPPED_COMPLETION_ROUTINE */
+    TEST_TYPE_SIZE   (LPOVERLAPPED_COMPLETION_ROUTINE, 4)
+    TEST_TYPE_ALIGN  (LPOVERLAPPED_COMPLETION_ROUTINE, 4)
+}
+
+static void test_pack_LPPROCESS_HEAP_ENTRY(void)
+{
+    /* LPPROCESS_HEAP_ENTRY */
+    TEST_TYPE_SIZE   (LPPROCESS_HEAP_ENTRY, 4)
+    TEST_TYPE_ALIGN  (LPPROCESS_HEAP_ENTRY, 4)
+}
+
+static void test_pack_LPPROCESS_INFORMATION(void)
+{
+    /* LPPROCESS_INFORMATION */
+    TEST_TYPE_SIZE   (LPPROCESS_INFORMATION, 4)
+    TEST_TYPE_ALIGN  (LPPROCESS_INFORMATION, 4)
+    TEST_TARGET_SIZE (LPPROCESS_INFORMATION, 16)
+    TEST_TARGET_ALIGN(LPPROCESS_INFORMATION, 4)
+}
+
+static void test_pack_LPPROGRESS_ROUTINE(void)
+{
+    /* LPPROGRESS_ROUTINE */
+    TEST_TYPE_SIZE   (LPPROGRESS_ROUTINE, 4)
+    TEST_TYPE_ALIGN  (LPPROGRESS_ROUTINE, 4)
+}
+
+static void test_pack_LPSECURITY_ATTRIBUTES(void)
+{
+    /* LPSECURITY_ATTRIBUTES */
+    TEST_TYPE_SIZE   (LPSECURITY_ATTRIBUTES, 4)
+    TEST_TYPE_ALIGN  (LPSECURITY_ATTRIBUTES, 4)
+    TEST_TARGET_SIZE (LPSECURITY_ATTRIBUTES, 12)
+    TEST_TARGET_ALIGN(LPSECURITY_ATTRIBUTES, 4)
+}
+
+static void test_pack_LPSTARTUPINFOA(void)
+{
+    /* LPSTARTUPINFOA */
+    TEST_TYPE_SIZE   (LPSTARTUPINFOA, 4)
+    TEST_TYPE_ALIGN  (LPSTARTUPINFOA, 4)
+    TEST_TARGET_SIZE (LPSTARTUPINFOA, 68)
+    TEST_TARGET_ALIGN(LPSTARTUPINFOA, 4)
+}
+
+static void test_pack_LPSTARTUPINFOW(void)
+{
+    /* LPSTARTUPINFOW */
+    TEST_TYPE_SIZE   (LPSTARTUPINFOW, 4)
+    TEST_TYPE_ALIGN  (LPSTARTUPINFOW, 4)
+    TEST_TARGET_SIZE (LPSTARTUPINFOW, 68)
+    TEST_TARGET_ALIGN(LPSTARTUPINFOW, 4)
+}
+
+static void test_pack_LPSYSTEMTIME(void)
+{
+    /* LPSYSTEMTIME */
+    TEST_TYPE_SIZE   (LPSYSTEMTIME, 4)
+    TEST_TYPE_ALIGN  (LPSYSTEMTIME, 4)
+    TEST_TARGET_SIZE (LPSYSTEMTIME, 16)
+    TEST_TARGET_ALIGN(LPSYSTEMTIME, 2)
+}
+
+static void test_pack_LPSYSTEM_INFO(void)
+{
+    /* LPSYSTEM_INFO */
+    TEST_TYPE_SIZE   (LPSYSTEM_INFO, 4)
+    TEST_TYPE_ALIGN  (LPSYSTEM_INFO, 4)
+}
+
+static void test_pack_LPSYSTEM_POWER_STATUS(void)
+{
+    /* LPSYSTEM_POWER_STATUS */
+    TEST_TYPE_SIZE   (LPSYSTEM_POWER_STATUS, 4)
+    TEST_TYPE_ALIGN  (LPSYSTEM_POWER_STATUS, 4)
+    TEST_TARGET_SIZE (LPSYSTEM_POWER_STATUS, 12)
+    TEST_TARGET_ALIGN(LPSYSTEM_POWER_STATUS, 4)
+}
+
+static void test_pack_LPTHREAD_START_ROUTINE(void)
+{
+    /* LPTHREAD_START_ROUTINE */
+    TEST_TYPE_SIZE   (LPTHREAD_START_ROUTINE, 4)
+    TEST_TYPE_ALIGN  (LPTHREAD_START_ROUTINE, 4)
+}
+
+static void test_pack_LPTIME_ZONE_INFORMATION(void)
+{
+    /* LPTIME_ZONE_INFORMATION */
+    TEST_TYPE_SIZE   (LPTIME_ZONE_INFORMATION, 4)
+    TEST_TYPE_ALIGN  (LPTIME_ZONE_INFORMATION, 4)
+    TEST_TARGET_SIZE (LPTIME_ZONE_INFORMATION, 172)
+    TEST_TARGET_ALIGN(LPTIME_ZONE_INFORMATION, 4)
+}
+
+static void test_pack_LPWIN32_FILE_ATTRIBUTE_DATA(void)
+{
+    /* LPWIN32_FILE_ATTRIBUTE_DATA */
+    TEST_TYPE_SIZE   (LPWIN32_FILE_ATTRIBUTE_DATA, 4)
+    TEST_TYPE_ALIGN  (LPWIN32_FILE_ATTRIBUTE_DATA, 4)
+    TEST_TARGET_SIZE (LPWIN32_FILE_ATTRIBUTE_DATA, 36)
+    TEST_TARGET_ALIGN(LPWIN32_FILE_ATTRIBUTE_DATA, 4)
+}
+
+static void test_pack_LPWIN32_FIND_DATAA(void)
+{
+    /* LPWIN32_FIND_DATAA */
+    TEST_TYPE_SIZE   (LPWIN32_FIND_DATAA, 4)
+    TEST_TYPE_ALIGN  (LPWIN32_FIND_DATAA, 4)
+    TEST_TARGET_SIZE (LPWIN32_FIND_DATAA, 320)
+    TEST_TARGET_ALIGN(LPWIN32_FIND_DATAA, 4)
+}
+
+static void test_pack_LPWIN32_FIND_DATAW(void)
+{
+    /* LPWIN32_FIND_DATAW */
+    TEST_TYPE_SIZE   (LPWIN32_FIND_DATAW, 4)
+    TEST_TYPE_ALIGN  (LPWIN32_FIND_DATAW, 4)
+    TEST_TARGET_SIZE (LPWIN32_FIND_DATAW, 592)
+    TEST_TARGET_ALIGN(LPWIN32_FIND_DATAW, 4)
+}
+
+static void test_pack_LPWIN32_STREAM_ID(void)
+{
+    /* LPWIN32_STREAM_ID */
+    TEST_TYPE_SIZE   (LPWIN32_STREAM_ID, 4)
+    TEST_TYPE_ALIGN  (LPWIN32_STREAM_ID, 4)
+    TEST_TARGET_SIZE (LPWIN32_STREAM_ID, 24)
+    TEST_TARGET_ALIGN(LPWIN32_STREAM_ID, 8)
+}
+
+static void test_pack_MEMORYSTATUS(void)
+{
+    /* MEMORYSTATUS (pack 4) */
+    TEST_TYPE_SIZE   (MEMORYSTATUS, 32)
+    TEST_TYPE_ALIGN  (MEMORYSTATUS, 4)
+    TEST_FIELD_SIZE  (MEMORYSTATUS, dwLength, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUS, dwLength, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUS, dwLength, 0)
+    TEST_FIELD_SIZE  (MEMORYSTATUS, dwMemoryLoad, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUS, dwMemoryLoad, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUS, dwMemoryLoad, 4)
+    TEST_FIELD_SIZE  (MEMORYSTATUS, dwTotalPhys, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUS, dwTotalPhys, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUS, dwTotalPhys, 8)
+    TEST_FIELD_SIZE  (MEMORYSTATUS, dwAvailPhys, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUS, dwAvailPhys, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUS, dwAvailPhys, 12)
+    TEST_FIELD_SIZE  (MEMORYSTATUS, dwTotalPageFile, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUS, dwTotalPageFile, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUS, dwTotalPageFile, 16)
+    TEST_FIELD_SIZE  (MEMORYSTATUS, dwAvailPageFile, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUS, dwAvailPageFile, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUS, dwAvailPageFile, 20)
+    TEST_FIELD_SIZE  (MEMORYSTATUS, dwTotalVirtual, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUS, dwTotalVirtual, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUS, dwTotalVirtual, 24)
+    TEST_FIELD_SIZE  (MEMORYSTATUS, dwAvailVirtual, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUS, dwAvailVirtual, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUS, dwAvailVirtual, 28)
+}
+
+static void test_pack_MEMORYSTATUSEX(void)
+{
+    /* MEMORYSTATUSEX (pack 8) */
+    TEST_TYPE_SIZE   (MEMORYSTATUSEX, 64)
+    TEST_TYPE_ALIGN  (MEMORYSTATUSEX, 8)
+    TEST_FIELD_SIZE  (MEMORYSTATUSEX, dwLength, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUSEX, dwLength, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUSEX, dwLength, 0)
+    TEST_FIELD_SIZE  (MEMORYSTATUSEX, dwMemoryLoad, 4)
+    TEST_FIELD_ALIGN (MEMORYSTATUSEX, dwMemoryLoad, 4)
+    TEST_FIELD_OFFSET(MEMORYSTATUSEX, dwMemoryLoad, 4)
+    TEST_FIELD_SIZE  (MEMORYSTATUSEX, ullTotalPhys, 8)
+    TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullTotalPhys, 8)
+    TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullTotalPhys, 8)
+    TEST_FIELD_SIZE  (MEMORYSTATUSEX, ullAvailPhys, 8)
+    TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullAvailPhys, 8)
+    TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullAvailPhys, 16)
+    TEST_FIELD_SIZE  (MEMORYSTATUSEX, ullTotalPageFile, 8)
+    TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullTotalPageFile, 8)
+    TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullTotalPageFile, 24)
+    TEST_FIELD_SIZE  (MEMORYSTATUSEX, ullAvailPageFile, 8)
+    TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullAvailPageFile, 8)
+    TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullAvailPageFile, 32)
+    TEST_FIELD_SIZE  (MEMORYSTATUSEX, ullTotalVirtual, 8)
+    TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullTotalVirtual, 8)
+    TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullTotalVirtual, 40)
+    TEST_FIELD_SIZE  (MEMORYSTATUSEX, ullAvailVirtual, 8)
+    TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullAvailVirtual, 8)
+    TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullAvailVirtual, 48)
+    TEST_FIELD_SIZE  (MEMORYSTATUSEX, ullAvailExtendedVirtual, 8)
+    TEST_FIELD_ALIGN (MEMORYSTATUSEX, ullAvailExtendedVirtual, 8)
+    TEST_FIELD_OFFSET(MEMORYSTATUSEX, ullAvailExtendedVirtual, 56)
+}
+
+static void test_pack_OFSTRUCT(void)
+{
+    /* OFSTRUCT (pack 4) */
+    TEST_TYPE_SIZE   (OFSTRUCT, 136)
+    TEST_TYPE_ALIGN  (OFSTRUCT, 2)
+    TEST_FIELD_SIZE  (OFSTRUCT, cBytes, 1)
+    TEST_FIELD_ALIGN (OFSTRUCT, cBytes, 1)
+    TEST_FIELD_OFFSET(OFSTRUCT, cBytes, 0)
+    TEST_FIELD_SIZE  (OFSTRUCT, fFixedDisk, 1)
+    TEST_FIELD_ALIGN (OFSTRUCT, fFixedDisk, 1)
+    TEST_FIELD_OFFSET(OFSTRUCT, fFixedDisk, 1)
+    TEST_FIELD_SIZE  (OFSTRUCT, nErrCode, 2)
+    TEST_FIELD_ALIGN (OFSTRUCT, nErrCode, 2)
+    TEST_FIELD_OFFSET(OFSTRUCT, nErrCode, 2)
+    TEST_FIELD_SIZE  (OFSTRUCT, Reserved1, 2)
+    TEST_FIELD_ALIGN (OFSTRUCT, Reserved1, 2)
+    TEST_FIELD_OFFSET(OFSTRUCT, Reserved1, 4)
+    TEST_FIELD_SIZE  (OFSTRUCT, Reserved2, 2)
+    TEST_FIELD_ALIGN (OFSTRUCT, Reserved2, 2)
+    TEST_FIELD_OFFSET(OFSTRUCT, Reserved2, 6)
+    TEST_FIELD_SIZE  (OFSTRUCT, szPathName, 128)
+    TEST_FIELD_ALIGN (OFSTRUCT, szPathName, 1)
+    TEST_FIELD_OFFSET(OFSTRUCT, szPathName, 8)
+}
+
+static void test_pack_OUTPUT_DEBUG_STRING_INFO(void)
+{
+    /* OUTPUT_DEBUG_STRING_INFO (pack 4) */
+    TEST_TYPE_SIZE   (OUTPUT_DEBUG_STRING_INFO, 8)
+    TEST_TYPE_ALIGN  (OUTPUT_DEBUG_STRING_INFO, 4)
+    TEST_FIELD_SIZE  (OUTPUT_DEBUG_STRING_INFO, lpDebugStringData, 4)
+    TEST_FIELD_ALIGN (OUTPUT_DEBUG_STRING_INFO, lpDebugStringData, 4)
+    TEST_FIELD_OFFSET(OUTPUT_DEBUG_STRING_INFO, lpDebugStringData, 0)
+    TEST_FIELD_SIZE  (OUTPUT_DEBUG_STRING_INFO, fUnicode, 2)
+    TEST_FIELD_ALIGN (OUTPUT_DEBUG_STRING_INFO, fUnicode, 2)
+    TEST_FIELD_OFFSET(OUTPUT_DEBUG_STRING_INFO, fUnicode, 4)
+    TEST_FIELD_SIZE  (OUTPUT_DEBUG_STRING_INFO, nDebugStringLength, 2)
+    TEST_FIELD_ALIGN (OUTPUT_DEBUG_STRING_INFO, nDebugStringLength, 2)
+    TEST_FIELD_OFFSET(OUTPUT_DEBUG_STRING_INFO, nDebugStringLength, 6)
+}
+
+static void test_pack_PACTCTXA(void)
+{
+    /* PACTCTXA */
+    TEST_TYPE_SIZE   (PACTCTXA, 4)
+    TEST_TYPE_ALIGN  (PACTCTXA, 4)
+    TEST_TARGET_SIZE (PACTCTXA, 32)
+    TEST_TARGET_ALIGN(PACTCTXA, 4)
+}
+
+static void test_pack_PACTCTXW(void)
+{
+    /* PACTCTXW */
+    TEST_TYPE_SIZE   (PACTCTXW, 4)
+    TEST_TYPE_ALIGN  (PACTCTXW, 4)
+    TEST_TARGET_SIZE (PACTCTXW, 32)
+    TEST_TARGET_ALIGN(PACTCTXW, 4)
+}
+
+static void test_pack_PACTCTX_SECTION_KEYED_DATA(void)
+{
+    /* PACTCTX_SECTION_KEYED_DATA */
+    TEST_TYPE_SIZE   (PACTCTX_SECTION_KEYED_DATA, 4)
+    TEST_TYPE_ALIGN  (PACTCTX_SECTION_KEYED_DATA, 4)
+    TEST_TARGET_SIZE (PACTCTX_SECTION_KEYED_DATA, 64)
+    TEST_TARGET_ALIGN(PACTCTX_SECTION_KEYED_DATA, 4)
+}
+
+static void test_pack_PACTCTX_SECTION_KEYED_DATA_2600(void)
+{
+    /* PACTCTX_SECTION_KEYED_DATA_2600 */
+    TEST_TYPE_SIZE   (PACTCTX_SECTION_KEYED_DATA_2600, 4)
+    TEST_TYPE_ALIGN  (PACTCTX_SECTION_KEYED_DATA_2600, 4)
+    TEST_TARGET_SIZE (PACTCTX_SECTION_KEYED_DATA_2600, 40)
+    TEST_TARGET_ALIGN(PACTCTX_SECTION_KEYED_DATA_2600, 4)
+}
+
+static void test_pack_PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(void)
+{
+    /* PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA */
+    TEST_TYPE_SIZE   (PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4)
+    TEST_TYPE_ALIGN  (PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4)
+    TEST_TARGET_SIZE (PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 20)
+    TEST_TARGET_ALIGN(PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4)
+}
+
+static void test_pack_PACTIVATION_CONTEXT_BASIC_INFORMATION(void)
+{
+    /* PACTIVATION_CONTEXT_BASIC_INFORMATION */
+    TEST_TYPE_SIZE   (PACTIVATION_CONTEXT_BASIC_INFORMATION, 4)
+    TEST_TYPE_ALIGN  (PACTIVATION_CONTEXT_BASIC_INFORMATION, 4)
+    TEST_TARGET_SIZE (PACTIVATION_CONTEXT_BASIC_INFORMATION, 8)
+    TEST_TARGET_ALIGN(PACTIVATION_CONTEXT_BASIC_INFORMATION, 4)
+}
+
+static void test_pack_PAPCFUNC(void)
+{
+    /* PAPCFUNC */
+    TEST_TYPE_SIZE   (PAPCFUNC, 4)
+    TEST_TYPE_ALIGN  (PAPCFUNC, 4)
+}
+
+static void test_pack_PBY_HANDLE_FILE_INFORMATION(void)
+{
+    /* PBY_HANDLE_FILE_INFORMATION */
+    TEST_TYPE_SIZE   (PBY_HANDLE_FILE_INFORMATION, 4)
+    TEST_TYPE_ALIGN  (PBY_HANDLE_FILE_INFORMATION, 4)
+    TEST_TARGET_SIZE (PBY_HANDLE_FILE_INFORMATION, 52)
+    TEST_TARGET_ALIGN(PBY_HANDLE_FILE_INFORMATION, 4)
+}
+
+static void test_pack_PCACTCTXA(void)
+{
+    /* PCACTCTXA */
+    TEST_TYPE_SIZE   (PCACTCTXA, 4)
+    TEST_TYPE_ALIGN  (PCACTCTXA, 4)
+    TEST_TARGET_SIZE (PCACTCTXA, 32)
+    TEST_TARGET_ALIGN(PCACTCTXA, 4)
+}
+
+static void test_pack_PCACTCTXW(void)
+{
+    /* PCACTCTXW */
+    TEST_TYPE_SIZE   (PCACTCTXW, 4)
+    TEST_TYPE_ALIGN  (PCACTCTXW, 4)
+    TEST_TARGET_SIZE (PCACTCTXW, 32)
+    TEST_TARGET_ALIGN(PCACTCTXW, 4)
+}
+
+static void test_pack_PCACTCTX_SECTION_KEYED_DATA(void)
+{
+    /* PCACTCTX_SECTION_KEYED_DATA */
+    TEST_TYPE_SIZE   (PCACTCTX_SECTION_KEYED_DATA, 4)
+    TEST_TYPE_ALIGN  (PCACTCTX_SECTION_KEYED_DATA, 4)
+    TEST_TARGET_SIZE (PCACTCTX_SECTION_KEYED_DATA, 64)
+    TEST_TARGET_ALIGN(PCACTCTX_SECTION_KEYED_DATA, 4)
+}
+
+static void test_pack_PCACTCTX_SECTION_KEYED_DATA_2600(void)
+{
+    /* PCACTCTX_SECTION_KEYED_DATA_2600 */
+    TEST_TYPE_SIZE   (PCACTCTX_SECTION_KEYED_DATA_2600, 4)
+    TEST_TYPE_ALIGN  (PCACTCTX_SECTION_KEYED_DATA_2600, 4)
+    TEST_TARGET_SIZE (PCACTCTX_SECTION_KEYED_DATA_2600, 40)
+    TEST_TARGET_ALIGN(PCACTCTX_SECTION_KEYED_DATA_2600, 4)
+}
+
+static void test_pack_PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA(void)
+{
+    /* PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA */
+    TEST_TYPE_SIZE   (PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4)
+    TEST_TYPE_ALIGN  (PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4)
+    TEST_TARGET_SIZE (PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 20)
+    TEST_TARGET_ALIGN(PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, 4)
+}
+
+static void test_pack_PCRITICAL_SECTION(void)
+{
+    /* PCRITICAL_SECTION */
+    TEST_TYPE_SIZE   (PCRITICAL_SECTION, 4)
+    TEST_TYPE_ALIGN  (PCRITICAL_SECTION, 4)
+}
+
+static void test_pack_PCRITICAL_SECTION_DEBUG(void)
+{
+    /* PCRITICAL_SECTION_DEBUG */
+    TEST_TYPE_SIZE   (PCRITICAL_SECTION_DEBUG, 4)
+    TEST_TYPE_ALIGN  (PCRITICAL_SECTION_DEBUG, 4)
+}
+
+static void test_pack_PFIBER_START_ROUTINE(void)
+{
+    /* PFIBER_START_ROUTINE */
+    TEST_TYPE_SIZE   (PFIBER_START_ROUTINE, 4)
+    TEST_TYPE_ALIGN  (PFIBER_START_ROUTINE, 4)
+}
+
+static void test_pack_POFSTRUCT(void)
+{
+    /* POFSTRUCT */
+    TEST_TYPE_SIZE   (POFSTRUCT, 4)
+    TEST_TYPE_ALIGN  (POFSTRUCT, 4)
+    TEST_TARGET_SIZE (POFSTRUCT, 136)
+    TEST_TARGET_ALIGN(POFSTRUCT, 2)
+}
+
+static void test_pack_PPROCESS_HEAP_ENTRY(void)
+{
+    /* PPROCESS_HEAP_ENTRY */
+    TEST_TYPE_SIZE   (PPROCESS_HEAP_ENTRY, 4)
+    TEST_TYPE_ALIGN  (PPROCESS_HEAP_ENTRY, 4)
+}
+
+static void test_pack_PPROCESS_INFORMATION(void)
+{
+    /* PPROCESS_INFORMATION */
+    TEST_TYPE_SIZE   (PPROCESS_INFORMATION, 4)
+    TEST_TYPE_ALIGN  (PPROCESS_INFORMATION, 4)
+    TEST_TARGET_SIZE (PPROCESS_INFORMATION, 16)
+    TEST_TARGET_ALIGN(PPROCESS_INFORMATION, 4)
+}
+
+static void test_pack_PQUERYACTCTXW_FUNC(void)
+{
+    /* PQUERYACTCTXW_FUNC */
+    TEST_TYPE_SIZE   (PQUERYACTCTXW_FUNC, 4)
+    TEST_TYPE_ALIGN  (PQUERYACTCTXW_FUNC, 4)
+}
+
+static void test_pack_PROCESS_HEAP_ENTRY(void)
+{
+    /* PROCESS_HEAP_ENTRY (pack 4) */
+    TEST_FIELD_SIZE  (PROCESS_HEAP_ENTRY, lpData, 4)
+    TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, lpData, 4)
+    TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, lpData, 0)
+    TEST_FIELD_SIZE  (PROCESS_HEAP_ENTRY, cbData, 4)
+    TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, cbData, 4)
+    TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, cbData, 4)
+    TEST_FIELD_SIZE  (PROCESS_HEAP_ENTRY, cbOverhead, 1)
+    TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, cbOverhead, 1)
+    TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, cbOverhead, 8)
+    TEST_FIELD_SIZE  (PROCESS_HEAP_ENTRY, iRegionIndex, 1)
+    TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, iRegionIndex, 1)
+    TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, iRegionIndex, 9)
+    TEST_FIELD_SIZE  (PROCESS_HEAP_ENTRY, wFlags, 2)
+    TEST_FIELD_ALIGN (PROCESS_HEAP_ENTRY, wFlags, 2)
+    TEST_FIELD_OFFSET(PROCESS_HEAP_ENTRY, wFlags, 10)
+}
+
+static void test_pack_PROCESS_INFORMATION(void)
+{
+    /* PROCESS_INFORMATION (pack 4) */
+    TEST_TYPE_SIZE   (PROCESS_INFORMATION, 16)
+    TEST_TYPE_ALIGN  (PROCESS_INFORMATION, 4)
+    TEST_FIELD_SIZE  (PROCESS_INFORMATION, hProcess, 4)
+    TEST_FIELD_ALIGN (PROCESS_INFORMATION, hProcess, 4)
+    TEST_FIELD_OFFSET(PROCESS_INFORMATION, hProcess, 0)
+    TEST_FIELD_SIZE  (PROCESS_INFORMATION, hThread, 4)
+    TEST_FIELD_ALIGN (PROCESS_INFORMATION, hThread, 4)
+    TEST_FIELD_OFFSET(PROCESS_INFORMATION, hThread, 4)
+    TEST_FIELD_SIZE  (PROCESS_INFORMATION, dwProcessId, 4)
+    TEST_FIELD_ALIGN (PROCESS_INFORMATION, dwProcessId, 4)
+    TEST_FIELD_OFFSET(PROCESS_INFORMATION, dwProcessId, 8)
+    TEST_FIELD_SIZE  (PROCESS_INFORMATION, dwThreadId, 4)
+    TEST_FIELD_ALIGN (PROCESS_INFORMATION, dwThreadId, 4)
+    TEST_FIELD_OFFSET(PROCESS_INFORMATION, dwThreadId, 12)
+}
+
+static void test_pack_PSECURITY_ATTRIBUTES(void)
+{
+    /* PSECURITY_ATTRIBUTES */
+    TEST_TYPE_SIZE   (PSECURITY_ATTRIBUTES, 4)
+    TEST_TYPE_ALIGN  (PSECURITY_ATTRIBUTES, 4)
+    TEST_TARGET_SIZE (PSECURITY_ATTRIBUTES, 12)
+    TEST_TARGET_ALIGN(PSECURITY_ATTRIBUTES, 4)
+}
+
+static void test_pack_PSYSTEMTIME(void)
+{
+    /* PSYSTEMTIME */
+    TEST_TYPE_SIZE   (PSYSTEMTIME, 4)
+    TEST_TYPE_ALIGN  (PSYSTEMTIME, 4)
+    TEST_TARGET_SIZE (PSYSTEMTIME, 16)
+    TEST_TARGET_ALIGN(PSYSTEMTIME, 2)
+}
+
+static void test_pack_PTIMERAPCROUTINE(void)
+{
+    /* PTIMERAPCROUTINE */
+    TEST_TYPE_SIZE   (PTIMERAPCROUTINE, 4)
+    TEST_TYPE_ALIGN  (PTIMERAPCROUTINE, 4)
+}
+
+static void test_pack_PTIME_ZONE_INFORMATION(void)
+{
+    /* PTIME_ZONE_INFORMATION */
+    TEST_TYPE_SIZE   (PTIME_ZONE_INFORMATION, 4)
+    TEST_TYPE_ALIGN  (PTIME_ZONE_INFORMATION, 4)
+    TEST_TARGET_SIZE (PTIME_ZONE_INFORMATION, 172)
+    TEST_TARGET_ALIGN(PTIME_ZONE_INFORMATION, 4)
+}
+
+static void test_pack_PWIN32_FIND_DATAA(void)
+{
+    /* PWIN32_FIND_DATAA */
+    TEST_TYPE_SIZE   (PWIN32_FIND_DATAA, 4)
+    TEST_TYPE_ALIGN  (PWIN32_FIND_DATAA, 4)
+    TEST_TARGET_SIZE (PWIN32_FIND_DATAA, 320)
+    TEST_TARGET_ALIGN(PWIN32_FIND_DATAA, 4)
+}
+
+static void test_pack_PWIN32_FIND_DATAW(void)
+{
+    /* PWIN32_FIND_DATAW */
+    TEST_TYPE_SIZE   (PWIN32_FIND_DATAW, 4)
+    TEST_TYPE_ALIGN  (PWIN32_FIND_DATAW, 4)
+    TEST_TARGET_SIZE (PWIN32_FIND_DATAW, 592)
+    TEST_TARGET_ALIGN(PWIN32_FIND_DATAW, 4)
+}
+
+static void test_pack_RIP_INFO(void)
+{
+    /* RIP_INFO (pack 4) */
+    TEST_TYPE_SIZE   (RIP_INFO, 8)
+    TEST_TYPE_ALIGN  (RIP_INFO, 4)
+    TEST_FIELD_SIZE  (RIP_INFO, dwError, 4)
+    TEST_FIELD_ALIGN (RIP_INFO, dwError, 4)
+    TEST_FIELD_OFFSET(RIP_INFO, dwError, 0)
+    TEST_FIELD_SIZE  (RIP_INFO, dwType, 4)
+    TEST_FIELD_ALIGN (RIP_INFO, dwType, 4)
+    TEST_FIELD_OFFSET(RIP_INFO, dwType, 4)
+}
+
+static void test_pack_SECURITY_ATTRIBUTES(void)
+{
+    /* SECURITY_ATTRIBUTES (pack 4) */
+    TEST_TYPE_SIZE   (SECURITY_ATTRIBUTES, 12)
+    TEST_TYPE_ALIGN  (SECURITY_ATTRIBUTES, 4)
+    TEST_FIELD_SIZE  (SECURITY_ATTRIBUTES, nLength, 4)
+    TEST_FIELD_ALIGN (SECURITY_ATTRIBUTES, nLength, 4)
+    TEST_FIELD_OFFSET(SECURITY_ATTRIBUTES, nLength, 0)
+    TEST_FIELD_SIZE  (SECURITY_ATTRIBUTES, lpSecurityDescriptor, 4)
+    TEST_FIELD_ALIGN (SECURITY_ATTRIBUTES, lpSecurityDescriptor, 4)
+    TEST_FIELD_OFFSET(SECURITY_ATTRIBUTES, lpSecurityDescriptor, 4)
+    TEST_FIELD_SIZE  (SECURITY_ATTRIBUTES, bInheritHandle, 4)
+    TEST_FIELD_ALIGN (SECURITY_ATTRIBUTES, bInheritHandle, 4)
+    TEST_FIELD_OFFSET(SECURITY_ATTRIBUTES, bInheritHandle, 8)
+}
+
+static void test_pack_STARTUPINFOA(void)
+{
+    /* STARTUPINFOA (pack 4) */
+    TEST_TYPE_SIZE   (STARTUPINFOA, 68)
+    TEST_TYPE_ALIGN  (STARTUPINFOA, 4)
+    TEST_FIELD_SIZE  (STARTUPINFOA, cb, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, cb, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, cb, 0)
+    TEST_FIELD_SIZE  (STARTUPINFOA, lpReserved, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, lpReserved, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, lpReserved, 4)
+    TEST_FIELD_SIZE  (STARTUPINFOA, lpDesktop, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, lpDesktop, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, lpDesktop, 8)
+    TEST_FIELD_SIZE  (STARTUPINFOA, lpTitle, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, lpTitle, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, lpTitle, 12)
+    TEST_FIELD_SIZE  (STARTUPINFOA, dwX, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, dwX, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, dwX, 16)
+    TEST_FIELD_SIZE  (STARTUPINFOA, dwY, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, dwY, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, dwY, 20)
+    TEST_FIELD_SIZE  (STARTUPINFOA, dwXSize, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, dwXSize, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, dwXSize, 24)
+    TEST_FIELD_SIZE  (STARTUPINFOA, dwYSize, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, dwYSize, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, dwYSize, 28)
+    TEST_FIELD_SIZE  (STARTUPINFOA, dwXCountChars, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, dwXCountChars, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, dwXCountChars, 32)
+    TEST_FIELD_SIZE  (STARTUPINFOA, dwYCountChars, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, dwYCountChars, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, dwYCountChars, 36)
+    TEST_FIELD_SIZE  (STARTUPINFOA, dwFillAttribute, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, dwFillAttribute, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, dwFillAttribute, 40)
+    TEST_FIELD_SIZE  (STARTUPINFOA, dwFlags, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, dwFlags, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, dwFlags, 44)
+    TEST_FIELD_SIZE  (STARTUPINFOA, wShowWindow, 2)
+    TEST_FIELD_ALIGN (STARTUPINFOA, wShowWindow, 2)
+    TEST_FIELD_OFFSET(STARTUPINFOA, wShowWindow, 48)
+    TEST_FIELD_SIZE  (STARTUPINFOA, cbReserved2, 2)
+    TEST_FIELD_ALIGN (STARTUPINFOA, cbReserved2, 2)
+    TEST_FIELD_OFFSET(STARTUPINFOA, cbReserved2, 50)
+    TEST_FIELD_SIZE  (STARTUPINFOA, lpReserved2, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, lpReserved2, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, lpReserved2, 52)
+    TEST_FIELD_SIZE  (STARTUPINFOA, hStdInput, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, hStdInput, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, hStdInput, 56)
+    TEST_FIELD_SIZE  (STARTUPINFOA, hStdOutput, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, hStdOutput, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, hStdOutput, 60)
+    TEST_FIELD_SIZE  (STARTUPINFOA, hStdError, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOA, hStdError, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOA, hStdError, 64)
+}
+
+static void test_pack_STARTUPINFOW(void)
+{
+    /* STARTUPINFOW (pack 4) */
+    TEST_TYPE_SIZE   (STARTUPINFOW, 68)
+    TEST_TYPE_ALIGN  (STARTUPINFOW, 4)
+    TEST_FIELD_SIZE  (STARTUPINFOW, cb, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, cb, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, cb, 0)
+    TEST_FIELD_SIZE  (STARTUPINFOW, lpReserved, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, lpReserved, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, lpReserved, 4)
+    TEST_FIELD_SIZE  (STARTUPINFOW, lpDesktop, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, lpDesktop, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, lpDesktop, 8)
+    TEST_FIELD_SIZE  (STARTUPINFOW, lpTitle, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, lpTitle, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, lpTitle, 12)
+    TEST_FIELD_SIZE  (STARTUPINFOW, dwX, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, dwX, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, dwX, 16)
+    TEST_FIELD_SIZE  (STARTUPINFOW, dwY, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, dwY, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, dwY, 20)
+    TEST_FIELD_SIZE  (STARTUPINFOW, dwXSize, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, dwXSize, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, dwXSize, 24)
+    TEST_FIELD_SIZE  (STARTUPINFOW, dwYSize, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, dwYSize, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, dwYSize, 28)
+    TEST_FIELD_SIZE  (STARTUPINFOW, dwXCountChars, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, dwXCountChars, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, dwXCountChars, 32)
+    TEST_FIELD_SIZE  (STARTUPINFOW, dwYCountChars, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, dwYCountChars, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, dwYCountChars, 36)
+    TEST_FIELD_SIZE  (STARTUPINFOW, dwFillAttribute, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, dwFillAttribute, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, dwFillAttribute, 40)
+    TEST_FIELD_SIZE  (STARTUPINFOW, dwFlags, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, dwFlags, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, dwFlags, 44)
+    TEST_FIELD_SIZE  (STARTUPINFOW, wShowWindow, 2)
+    TEST_FIELD_ALIGN (STARTUPINFOW, wShowWindow, 2)
+    TEST_FIELD_OFFSET(STARTUPINFOW, wShowWindow, 48)
+    TEST_FIELD_SIZE  (STARTUPINFOW, cbReserved2, 2)
+    TEST_FIELD_ALIGN (STARTUPINFOW, cbReserved2, 2)
+    TEST_FIELD_OFFSET(STARTUPINFOW, cbReserved2, 50)
+    TEST_FIELD_SIZE  (STARTUPINFOW, lpReserved2, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, lpReserved2, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, lpReserved2, 52)
+    TEST_FIELD_SIZE  (STARTUPINFOW, hStdInput, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, hStdInput, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, hStdInput, 56)
+    TEST_FIELD_SIZE  (STARTUPINFOW, hStdOutput, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, hStdOutput, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, hStdOutput, 60)
+    TEST_FIELD_SIZE  (STARTUPINFOW, hStdError, 4)
+    TEST_FIELD_ALIGN (STARTUPINFOW, hStdError, 4)
+    TEST_FIELD_OFFSET(STARTUPINFOW, hStdError, 64)
+}
+
+static void test_pack_SYSTEMTIME(void)
+{
+    /* SYSTEMTIME (pack 4) */
+    TEST_TYPE_SIZE   (SYSTEMTIME, 16)
+    TEST_TYPE_ALIGN  (SYSTEMTIME, 2)
+    TEST_FIELD_SIZE  (SYSTEMTIME, wYear, 2)
+    TEST_FIELD_ALIGN (SYSTEMTIME, wYear, 2)
+    TEST_FIELD_OFFSET(SYSTEMTIME, wYear, 0)
+    TEST_FIELD_SIZE  (SYSTEMTIME, wMonth, 2)
+    TEST_FIELD_ALIGN (SYSTEMTIME, wMonth, 2)
+    TEST_FIELD_OFFSET(SYSTEMTIME, wMonth, 2)
+    TEST_FIELD_SIZE  (SYSTEMTIME, wDayOfWeek, 2)
+    TEST_FIELD_ALIGN (SYSTEMTIME, wDayOfWeek, 2)
+    TEST_FIELD_OFFSET(SYSTEMTIME, wDayOfWeek, 4)
+    TEST_FIELD_SIZE  (SYSTEMTIME, wDay, 2)
+    TEST_FIELD_ALIGN (SYSTEMTIME, wDay, 2)
+    TEST_FIELD_OFFSET(SYSTEMTIME, wDay, 6)
+    TEST_FIELD_SIZE  (SYSTEMTIME, wHour, 2)
+    TEST_FIELD_ALIGN (SYSTEMTIME, wHour, 2)
+    TEST_FIELD_OFFSET(SYSTEMTIME, wHour, 8)
+    TEST_FIELD_SIZE  (SYSTEMTIME, wMinute, 2)
+    TEST_FIELD_ALIGN (SYSTEMTIME, wMinute, 2)
+    TEST_FIELD_OFFSET(SYSTEMTIME, wMinute, 10)
+    TEST_FIELD_SIZE  (SYSTEMTIME, wSecond, 2)
+    TEST_FIELD_ALIGN (SYSTEMTIME, wSecond, 2)
+    TEST_FIELD_OFFSET(SYSTEMTIME, wSecond, 12)
+    TEST_FIELD_SIZE  (SYSTEMTIME, wMilliseconds, 2)
+    TEST_FIELD_ALIGN (SYSTEMTIME, wMilliseconds, 2)
+    TEST_FIELD_OFFSET(SYSTEMTIME, wMilliseconds, 14)
+}
+
+static void test_pack_SYSTEM_INFO(void)
+{
+    /* SYSTEM_INFO (pack 4) */
+}
+
+static void test_pack_SYSTEM_POWER_STATUS(void)
+{
+    /* SYSTEM_POWER_STATUS (pack 4) */
+    TEST_TYPE_SIZE   (SYSTEM_POWER_STATUS, 12)
+    TEST_TYPE_ALIGN  (SYSTEM_POWER_STATUS, 4)
+    TEST_FIELD_SIZE  (SYSTEM_POWER_STATUS, ACLineStatus, 1)
+    TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, ACLineStatus, 1)
+    TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, ACLineStatus, 0)
+    TEST_FIELD_SIZE  (SYSTEM_POWER_STATUS, BatteryFlag, 1)
+    TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, BatteryFlag, 1)
+    TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, BatteryFlag, 1)
+    TEST_FIELD_SIZE  (SYSTEM_POWER_STATUS, BatteryLifePercent, 1)
+    TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, BatteryLifePercent, 1)
+    TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, BatteryLifePercent, 2)
+    TEST_FIELD_SIZE  (SYSTEM_POWER_STATUS, Reserved1, 1)
+    TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, Reserved1, 1)
+    TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, Reserved1, 3)
+    TEST_FIELD_SIZE  (SYSTEM_POWER_STATUS, BatteryLifeTime, 4)
+    TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, BatteryLifeTime, 4)
+    TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, BatteryLifeTime, 4)
+    TEST_FIELD_SIZE  (SYSTEM_POWER_STATUS, BatteryFullLifeTime, 4)
+    TEST_FIELD_ALIGN (SYSTEM_POWER_STATUS, BatteryFullLifeTime, 4)
+    TEST_FIELD_OFFSET(SYSTEM_POWER_STATUS, BatteryFullLifeTime, 8)
+}
+
+static void test_pack_TIME_ZONE_INFORMATION(void)
+{
+    /* TIME_ZONE_INFORMATION (pack 4) */
+    TEST_TYPE_SIZE   (TIME_ZONE_INFORMATION, 172)
+    TEST_TYPE_ALIGN  (TIME_ZONE_INFORMATION, 4)
+    TEST_FIELD_SIZE  (TIME_ZONE_INFORMATION, Bias, 4)
+    TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, Bias, 4)
+    TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, Bias, 0)
+    TEST_FIELD_SIZE  (TIME_ZONE_INFORMATION, StandardName, 64)
+    TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, StandardName, 2)
+    TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, StandardName, 4)
+    TEST_FIELD_SIZE  (TIME_ZONE_INFORMATION, StandardDate, 16)
+    TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, StandardDate, 2)
+    TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, StandardDate, 68)
+    TEST_FIELD_SIZE  (TIME_ZONE_INFORMATION, StandardBias, 4)
+    TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, StandardBias, 4)
+    TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, StandardBias, 84)
+    TEST_FIELD_SIZE  (TIME_ZONE_INFORMATION, DaylightName, 64)
+    TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, DaylightName, 2)
+    TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, DaylightName, 88)
+    TEST_FIELD_SIZE  (TIME_ZONE_INFORMATION, DaylightDate, 16)
+    TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, DaylightDate, 2)
+    TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, DaylightDate, 152)
+    TEST_FIELD_SIZE  (TIME_ZONE_INFORMATION, DaylightBias, 4)
+    TEST_FIELD_ALIGN (TIME_ZONE_INFORMATION, DaylightBias, 4)
+    TEST_FIELD_OFFSET(TIME_ZONE_INFORMATION, DaylightBias, 168)
+}
+
+static void test_pack_UNLOAD_DLL_DEBUG_INFO(void)
+{
+    /* UNLOAD_DLL_DEBUG_INFO (pack 4) */
+    TEST_TYPE_SIZE   (UNLOAD_DLL_DEBUG_INFO, 4)
+    TEST_TYPE_ALIGN  (UNLOAD_DLL_DEBUG_INFO, 4)
+    TEST_FIELD_SIZE  (UNLOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4)
+    TEST_FIELD_ALIGN (UNLOAD_DLL_DEBUG_INFO, lpBaseOfDll, 4)
+    TEST_FIELD_OFFSET(UNLOAD_DLL_DEBUG_INFO, lpBaseOfDll, 0)
+}
+
+static void test_pack_WAITORTIMERCALLBACK(void)
+{
+    /* WAITORTIMERCALLBACK */
+    TEST_TYPE_SIZE   (WAITORTIMERCALLBACK, 4)
+    TEST_TYPE_ALIGN  (WAITORTIMERCALLBACK, 4)
+}
+
+static void test_pack_WIN32_FILE_ATTRIBUTE_DATA(void)
+{
+    /* WIN32_FILE_ATTRIBUTE_DATA (pack 4) */
+    TEST_TYPE_SIZE   (WIN32_FILE_ATTRIBUTE_DATA, 36)
+    TEST_TYPE_ALIGN  (WIN32_FILE_ATTRIBUTE_DATA, 4)
+    TEST_FIELD_SIZE  (WIN32_FILE_ATTRIBUTE_DATA, dwFileAttributes, 4)
+    TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, dwFileAttributes, 4)
+    TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, dwFileAttributes, 0)
+    TEST_FIELD_SIZE  (WIN32_FILE_ATTRIBUTE_DATA, ftCreationTime, 8)
+    TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, ftCreationTime, 4)
+    TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, ftCreationTime, 4)
+    TEST_FIELD_SIZE  (WIN32_FILE_ATTRIBUTE_DATA, ftLastAccessTime, 8)
+    TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, ftLastAccessTime, 4)
+    TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, ftLastAccessTime, 12)
+    TEST_FIELD_SIZE  (WIN32_FILE_ATTRIBUTE_DATA, ftLastWriteTime, 8)
+    TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, ftLastWriteTime, 4)
+    TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, ftLastWriteTime, 20)
+    TEST_FIELD_SIZE  (WIN32_FILE_ATTRIBUTE_DATA, nFileSizeHigh, 4)
+    TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, nFileSizeHigh, 4)
+    TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, nFileSizeHigh, 28)
+    TEST_FIELD_SIZE  (WIN32_FILE_ATTRIBUTE_DATA, nFileSizeLow, 4)
+    TEST_FIELD_ALIGN (WIN32_FILE_ATTRIBUTE_DATA, nFileSizeLow, 4)
+    TEST_FIELD_OFFSET(WIN32_FILE_ATTRIBUTE_DATA, nFileSizeLow, 32)
+}
+
+static void test_pack_WIN32_FIND_DATAA(void)
+{
+    /* WIN32_FIND_DATAA (pack 4) */
+    TEST_TYPE_SIZE   (WIN32_FIND_DATAA, 320)
+    TEST_TYPE_ALIGN  (WIN32_FIND_DATAA, 4)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, dwFileAttributes, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, dwFileAttributes, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, dwFileAttributes, 0)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, ftCreationTime, 8)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, ftCreationTime, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, ftCreationTime, 4)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, ftLastAccessTime, 8)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, ftLastAccessTime, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, ftLastAccessTime, 12)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, ftLastWriteTime, 8)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, ftLastWriteTime, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, ftLastWriteTime, 20)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, nFileSizeHigh, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, nFileSizeHigh, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, nFileSizeHigh, 28)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, nFileSizeLow, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, nFileSizeLow, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, nFileSizeLow, 32)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, dwReserved0, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, dwReserved0, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, dwReserved0, 36)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, dwReserved1, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, dwReserved1, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, dwReserved1, 40)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, cFileName, 260)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, cFileName, 1)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, cFileName, 44)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAA, cAlternateFileName, 14)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAA, cAlternateFileName, 1)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAA, cAlternateFileName, 304)
+}
+
+static void test_pack_WIN32_FIND_DATAW(void)
+{
+    /* WIN32_FIND_DATAW (pack 4) */
+    TEST_TYPE_SIZE   (WIN32_FIND_DATAW, 592)
+    TEST_TYPE_ALIGN  (WIN32_FIND_DATAW, 4)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, dwFileAttributes, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, dwFileAttributes, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, dwFileAttributes, 0)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, ftCreationTime, 8)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, ftCreationTime, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, ftCreationTime, 4)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, ftLastAccessTime, 8)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, ftLastAccessTime, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, ftLastAccessTime, 12)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, ftLastWriteTime, 8)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, ftLastWriteTime, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, ftLastWriteTime, 20)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, nFileSizeHigh, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, nFileSizeHigh, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, nFileSizeHigh, 28)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, nFileSizeLow, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, nFileSizeLow, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, nFileSizeLow, 32)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, dwReserved0, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, dwReserved0, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, dwReserved0, 36)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, dwReserved1, 4)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, dwReserved1, 4)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, dwReserved1, 40)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, cFileName, 520)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, cFileName, 2)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, cFileName, 44)
+    TEST_FIELD_SIZE  (WIN32_FIND_DATAW, cAlternateFileName, 28)
+    TEST_FIELD_ALIGN (WIN32_FIND_DATAW, cAlternateFileName, 2)
+    TEST_FIELD_OFFSET(WIN32_FIND_DATAW, cAlternateFileName, 564)
+}
+
+static void test_pack_WIN32_STREAM_ID(void)
+{
+    /* WIN32_STREAM_ID (pack 8) */
+    TEST_TYPE_SIZE   (WIN32_STREAM_ID, 24)
+    TEST_TYPE_ALIGN  (WIN32_STREAM_ID, 8)
+    TEST_FIELD_SIZE  (WIN32_STREAM_ID, dwStreamId, 4)
+    TEST_FIELD_ALIGN (WIN32_STREAM_ID, dwStreamId, 4)
+    TEST_FIELD_OFFSET(WIN32_STREAM_ID, dwStreamId, 0)
+    TEST_FIELD_SIZE  (WIN32_STREAM_ID, dwStreamAttributes, 4)
+    TEST_FIELD_ALIGN (WIN32_STREAM_ID, dwStreamAttributes, 4)
+    TEST_FIELD_OFFSET(WIN32_STREAM_ID, dwStreamAttributes, 4)
+    TEST_FIELD_SIZE  (WIN32_STREAM_ID, Size, 8)
+    TEST_FIELD_ALIGN (WIN32_STREAM_ID, Size, 8)
+    TEST_FIELD_OFFSET(WIN32_STREAM_ID, Size, 8)
+    TEST_FIELD_SIZE  (WIN32_STREAM_ID, dwStreamNameSize, 4)
+    TEST_FIELD_ALIGN (WIN32_STREAM_ID, dwStreamNameSize, 4)
+    TEST_FIELD_OFFSET(WIN32_STREAM_ID, dwStreamNameSize, 16)
+    TEST_FIELD_SIZE  (WIN32_STREAM_ID, cStreamName, 2)
+    TEST_FIELD_ALIGN (WIN32_STREAM_ID, cStreamName, 2)
+    TEST_FIELD_OFFSET(WIN32_STREAM_ID, cStreamName, 20)
+}
+
+static void test_pack(void)
+{
+    test_pack_ACTCTXA();
+    test_pack_ACTCTXW();
+    test_pack_ACTCTX_SECTION_KEYED_DATA();
+    test_pack_ACTCTX_SECTION_KEYED_DATA_2600();
+    test_pack_ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA();
+    test_pack_ACTIVATION_CONTEXT_BASIC_INFORMATION();
+    test_pack_BY_HANDLE_FILE_INFORMATION();
+    test_pack_COMMCONFIG();
+    test_pack_COMMPROP();
+    test_pack_COMMTIMEOUTS();
+    test_pack_COMSTAT();
+    test_pack_CREATE_PROCESS_DEBUG_INFO();
+    test_pack_CREATE_THREAD_DEBUG_INFO();
+    test_pack_CRITICAL_SECTION();
+    test_pack_CRITICAL_SECTION_DEBUG();
+    test_pack_DCB();
+    test_pack_DEBUG_EVENT();
+    test_pack_ENUMRESLANGPROCA();
+    test_pack_ENUMRESLANGPROCW();
+    test_pack_ENUMRESNAMEPROCA();
+    test_pack_ENUMRESNAMEPROCW();
+    test_pack_ENUMRESTYPEPROCA();
+    test_pack_ENUMRESTYPEPROCW();
+    test_pack_EXCEPTION_DEBUG_INFO();
+    test_pack_EXIT_PROCESS_DEBUG_INFO();
+    test_pack_EXIT_THREAD_DEBUG_INFO();
+    test_pack_HW_PROFILE_INFOA();
+    test_pack_HW_PROFILE_INFOW();
+    test_pack_LOAD_DLL_DEBUG_INFO();
+    test_pack_LPBY_HANDLE_FILE_INFORMATION();
+    test_pack_LPCOMMCONFIG();
+    test_pack_LPCOMMPROP();
+    test_pack_LPCOMMTIMEOUTS();
+    test_pack_LPCOMSTAT();
+    test_pack_LPCRITICAL_SECTION();
+    test_pack_LPCRITICAL_SECTION_DEBUG();
+    test_pack_LPDCB();
+    test_pack_LPDEBUG_EVENT();
+    test_pack_LPEXCEPTION_POINTERS();
+    test_pack_LPEXCEPTION_RECORD();
+    test_pack_LPFIBER_START_ROUTINE();
+    test_pack_LPHW_PROFILE_INFOA();
+    test_pack_LPHW_PROFILE_INFOW();
+    test_pack_LPLONG();
+    test_pack_LPMEMORYSTATUS();
+    test_pack_LPMEMORYSTATUSEX();
+    test_pack_LPOFSTRUCT();
+    test_pack_LPOSVERSIONINFOA();
+    test_pack_LPOSVERSIONINFOEXA();
+    test_pack_LPOSVERSIONINFOEXW();
+    test_pack_LPOSVERSIONINFOW();
+    test_pack_LPOVERLAPPED();
+    test_pack_LPOVERLAPPED_COMPLETION_ROUTINE();
+    test_pack_LPPROCESS_HEAP_ENTRY();
+    test_pack_LPPROCESS_INFORMATION();
+    test_pack_LPPROGRESS_ROUTINE();
+    test_pack_LPSECURITY_ATTRIBUTES();
+    test_pack_LPSTARTUPINFOA();
+    test_pack_LPSTARTUPINFOW();
+    test_pack_LPSYSTEMTIME();
+    test_pack_LPSYSTEM_INFO();
+    test_pack_LPSYSTEM_POWER_STATUS();
+    test_pack_LPTHREAD_START_ROUTINE();
+    test_pack_LPTIME_ZONE_INFORMATION();
+    test_pack_LPVOID();
+    test_pack_LPWIN32_FILE_ATTRIBUTE_DATA();
+    test_pack_LPWIN32_FIND_DATAA();
+    test_pack_LPWIN32_FIND_DATAW();
+    test_pack_LPWIN32_STREAM_ID();
+    test_pack_MEMORYSTATUS();
+    test_pack_MEMORYSTATUSEX();
+    test_pack_OFSTRUCT();
+    test_pack_OSVERSIONINFOA();
+    test_pack_OSVERSIONINFOEXA();
+    test_pack_OSVERSIONINFOEXW();
+    test_pack_OSVERSIONINFOW();
+    test_pack_OUTPUT_DEBUG_STRING_INFO();
+    test_pack_PACTCTXA();
+    test_pack_PACTCTXW();
+    test_pack_PACTCTX_SECTION_KEYED_DATA();
+    test_pack_PACTCTX_SECTION_KEYED_DATA_2600();
+    test_pack_PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA();
+    test_pack_PACTIVATION_CONTEXT_BASIC_INFORMATION();
+    test_pack_PAPCFUNC();
+    test_pack_PBY_HANDLE_FILE_INFORMATION();
+    test_pack_PCACTCTXA();
+    test_pack_PCACTCTXW();
+    test_pack_PCACTCTX_SECTION_KEYED_DATA();
+    test_pack_PCACTCTX_SECTION_KEYED_DATA_2600();
+    test_pack_PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA();
+    test_pack_PCRITICAL_SECTION();
+    test_pack_PCRITICAL_SECTION_DEBUG();
+    test_pack_PFIBER_START_ROUTINE();
+    test_pack_PHKEY();
+    test_pack_POFSTRUCT();
+    test_pack_POSVERSIONINFOA();
+    test_pack_POSVERSIONINFOEXA();
+    test_pack_POSVERSIONINFOEXW();
+    test_pack_POSVERSIONINFOW();
+    test_pack_PPROCESS_HEAP_ENTRY();
+    test_pack_PPROCESS_INFORMATION();
+    test_pack_PQUERYACTCTXW_FUNC();
+    test_pack_PROCESS_HEAP_ENTRY();
+    test_pack_PROCESS_INFORMATION();
+    test_pack_PSECURITY_ATTRIBUTES();
+    test_pack_PSYSTEMTIME();
+    test_pack_PTIMERAPCROUTINE();
+    test_pack_PTIME_ZONE_INFORMATION();
+    test_pack_PWIN32_FIND_DATAA();
+    test_pack_PWIN32_FIND_DATAW();
+    test_pack_RIP_INFO();
+    test_pack_SECURITY_ATTRIBUTES();
+    test_pack_STARTUPINFOA();
+    test_pack_STARTUPINFOW();
+    test_pack_SYSTEMTIME();
+    test_pack_SYSTEM_INFO();
+    test_pack_SYSTEM_POWER_STATUS();
+    test_pack_TIME_ZONE_INFORMATION();
+    test_pack_UNLOAD_DLL_DEBUG_INFO();
+    test_pack_WAITORTIMERCALLBACK();
+    test_pack_WIN32_FILE_ATTRIBUTE_DATA();
+    test_pack_WIN32_FIND_DATAA();
+    test_pack_WIN32_FIND_DATAW();
+    test_pack_WIN32_STREAM_ID();
+}
+
+START_TEST(generated)
+{
+#ifdef _WIN64
+    ok(0, "The type size / alignment tests don't support Win64 yet\n");
+#else
+    test_pack();
+#endif
+}
index 56f9744..7c755b9 100755 (executable)
 
 #include <stdarg.h>
 #include <stdlib.h>
+#include <stdio.h>
+
+#define WIN32_NO_STATUS
+#include <windows.h>
+#define NTOS_MODE_USER
+#include <ndk/ntndk.h>
 
-#include "windef.h"
-#include "winbase.h"
 #include "wine/test.h"
 
+
 #define MAGIC_DEAD 0xdeadbeef
 
+/* some undocumented flags (names are made up) */
+#define HEAP_PAGE_ALLOCS      0x01000000
+#define HEAP_VALIDATE         0x10000000
+#define HEAP_VALIDATE_ALL     0x20000000
+#define HEAP_VALIDATE_PARAMS  0x40000000
+
 static BOOL (WINAPI *pHeapQueryInformation)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
+static ULONG (WINAPI *pRtlGetNtGlobalFlags)(void);
+
+struct heap_layout
+{
+    DWORD_PTR unknown[2];
+    DWORD pattern;
+    DWORD flags;
+    DWORD force_flags;
+};
 
 static SIZE_T resize_9x(SIZE_T size)
 {
@@ -467,8 +487,307 @@ static void test_HeapQueryInformation(void)
     ok(info == 0 || info == 1 || info == 2, "expected 0, 1 or 2, got %u\n", info);
 }
 
+static void test_heap_checks( DWORD flags )
+{
+    BYTE old, *p, *p2;
+    BOOL ret;
+    SIZE_T i, size, large_size = 3000 * 1024 + 37;
+
+    if (flags & HEAP_PAGE_ALLOCS) return;  /* no tests for that case yet */
+    trace( "testing heap flags %08x\n", flags );
+
+    p = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 17 );
+    ok( p != NULL, "HeapAlloc failed\n" );
+
+    ret = HeapValidate( GetProcessHeap(), 0, p );
+    ok( ret, "HeapValidate failed\n" );
+
+    size = HeapSize( GetProcessHeap(), 0, p );
+    ok( size == 17, "Wrong size %lu\n", size );
+
+    ok( p[14] == 0, "wrong data %x\n", p[14] );
+    ok( p[15] == 0, "wrong data %x\n", p[15] );
+    ok( p[16] == 0, "wrong data %x\n", p[16] );
+
+    if (flags & HEAP_TAIL_CHECKING_ENABLED)
+    {
+        ok( p[17] == 0xab, "wrong padding %x\n", p[17] );
+        ok( p[18] == 0xab, "wrong padding %x\n", p[18] );
+        ok( p[19] == 0xab, "wrong padding %x\n", p[19] );
+    }
+
+    p2 = HeapReAlloc( GetProcessHeap(), HEAP_REALLOC_IN_PLACE_ONLY, p, 14 );
+    if (p2 == p)
+    {
+        if (flags & HEAP_TAIL_CHECKING_ENABLED)
+        {
+            ok( p[14] == 0xab, "wrong padding %x\n", p[14] );
+            ok( p[15] == 0xab, "wrong padding %x\n", p[15] );
+            ok( p[16] == 0xab, "wrong padding %x\n", p[16] );
+        }
+        else
+        {
+            ok( p[14] == 0, "wrong padding %x\n", p[14] );
+            ok( p[15] == 0, "wrong padding %x\n", p[15] );
+        }
+    }
+    else skip( "realloc in place failed\n ");
+
+    ret = HeapFree( GetProcessHeap(), 0, p );
+    ok( ret, "HeapFree failed\n" );
+
+    p = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 17 );
+    ok( p != NULL, "HeapAlloc failed\n" );
+    old = p[17];
+    p[17] = 0xcc;
+
+    if (flags & HEAP_TAIL_CHECKING_ENABLED)
+    {
+        ret = HeapValidate( GetProcessHeap(), 0, p );
+        ok( !ret, "HeapValidate succeeded\n" );
+
+        /* other calls only check when HEAP_VALIDATE is set */
+        if (flags & HEAP_VALIDATE)
+        {
+            size = HeapSize( GetProcessHeap(), 0, p );
+            ok( size == ~(SIZE_T)0 || broken(size == ~0u), "Wrong size %lu\n", size );
+
+            p2 = HeapReAlloc( GetProcessHeap(), 0, p, 14 );
+            ok( p2 == NULL, "HeapReAlloc succeeded\n" );
+
+            ret = HeapFree( GetProcessHeap(), 0, p );
+            ok( !ret || broken(sizeof(void*) == 8), /* not caught on xp64 */
+                "HeapFree succeeded\n" );
+        }
+
+        p[17] = old;
+        size = HeapSize( GetProcessHeap(), 0, p );
+        ok( size == 17, "Wrong size %lu\n", size );
+
+        p2 = HeapReAlloc( GetProcessHeap(), 0, p, 14 );
+        ok( p2 != NULL, "HeapReAlloc failed\n" );
+        p = p2;
+    }
+
+    ret = HeapFree( GetProcessHeap(), 0, p );
+    ok( ret, "HeapFree failed\n" );
+
+    p = HeapAlloc( GetProcessHeap(), 0, 37 );
+    ok( p != NULL, "HeapAlloc failed\n" );
+    memset( p, 0xcc, 37 );
+
+    ret = HeapFree( GetProcessHeap(), 0, p );
+    ok( ret, "HeapFree failed\n" );
+
+    if (flags & HEAP_FREE_CHECKING_ENABLED)
+    {
+        ok( p[16] == 0xee, "wrong data %x\n", p[16] );
+        ok( p[17] == 0xfe, "wrong data %x\n", p[17] );
+        ok( p[18] == 0xee, "wrong data %x\n", p[18] );
+        ok( p[19] == 0xfe, "wrong data %x\n", p[19] );
+
+        ret = HeapValidate( GetProcessHeap(), 0, NULL );
+        ok( ret, "HeapValidate failed\n" );
+
+        old = p[16];
+        p[16] = 0xcc;
+        ret = HeapValidate( GetProcessHeap(), 0, NULL );
+        ok( !ret, "HeapValidate succeeded\n" );
+
+        p[16] = old;
+        ret = HeapValidate( GetProcessHeap(), 0, NULL );
+        ok( ret, "HeapValidate failed\n" );
+    }
+
+    /* now test large blocks */
+
+    p = HeapAlloc( GetProcessHeap(), 0, large_size );
+    ok( p != NULL, "HeapAlloc failed\n" );
+
+    ret = HeapValidate( GetProcessHeap(), 0, p );
+    ok( ret, "HeapValidate failed\n" );
+
+    size = HeapSize( GetProcessHeap(), 0, p );
+    ok( size == large_size, "Wrong size %lu\n", size );
+
+    ok( p[large_size - 2] == 0, "wrong data %x\n", p[large_size - 2] );
+    ok( p[large_size - 1] == 0, "wrong data %x\n", p[large_size - 1] );
+
+    if (flags & HEAP_TAIL_CHECKING_ENABLED)
+    {
+        /* Windows doesn't do tail checking on large blocks */
+        ok( p[large_size] == 0xab || broken(p[large_size] == 0), "wrong data %x\n", p[large_size] );
+        ok( p[large_size+1] == 0xab || broken(p[large_size+1] == 0), "wrong data %x\n", p[large_size+1] );
+        ok( p[large_size+2] == 0xab || broken(p[large_size+2] == 0), "wrong data %x\n", p[large_size+2] );
+        if (p[large_size] == 0xab)
+        {
+            p[large_size] = 0xcc;
+            ret = HeapValidate( GetProcessHeap(), 0, p );
+            ok( !ret, "HeapValidate succeeded\n" );
+
+            /* other calls only check when HEAP_VALIDATE is set */
+            if (flags & HEAP_VALIDATE)
+            {
+                size = HeapSize( GetProcessHeap(), 0, p );
+                ok( size == ~(SIZE_T)0, "Wrong size %lu\n", size );
+
+                p2 = HeapReAlloc( GetProcessHeap(), 0, p, large_size - 3 );
+                ok( p2 == NULL, "HeapReAlloc succeeded\n" );
+
+                ret = HeapFree( GetProcessHeap(), 0, p );
+                ok( !ret, "HeapFree succeeded\n" );
+            }
+            p[large_size] = 0xab;
+        }
+    }
+
+    ret = HeapFree( GetProcessHeap(), 0, p );
+    ok( ret, "HeapFree failed\n" );
+
+    /* test block sizes when tail checking */
+    if (flags & HEAP_TAIL_CHECKING_ENABLED)
+    {
+        for (size = 0; size < 64; size++)
+        {
+            p = HeapAlloc( GetProcessHeap(), 0, size );
+            for (i = 0; i < 32; i++) if (p[size + i] != 0xab) break;
+            ok( i >= 8, "only %lu tail bytes for size %lu\n", i, size );
+            HeapFree( GetProcessHeap(), 0, p );
+        }
+    }
+}
+
+static void test_debug_heap( const char *argv0, DWORD flags )
+{
+    char keyname[MAX_PATH];
+    char buffer[MAX_PATH];
+    PROCESS_INFORMATION        info;
+    STARTUPINFOA startup;
+    BOOL ret;
+    DWORD err;
+    HKEY hkey;
+    const char *basename;
+
+    if ((basename = strrchr( argv0, '\\' ))) basename++;
+    else basename = argv0;
+
+    sprintf( keyname, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\%s",
+             basename );
+    if (!strcmp( keyname + strlen(keyname) - 3, ".so" )) keyname[strlen(keyname) - 3] = 0;
+
+    err = RegCreateKeyA( HKEY_LOCAL_MACHINE, keyname, &hkey );
+    ok( !err, "failed to create '%s' error %u\n", keyname, err );
+    if (err) return;
+
+    if (flags == 0xdeadbeef)  /* magic value for unsetting it */
+        RegDeleteValueA( hkey, "GlobalFlag" );
+    else
+        RegSetValueExA( hkey, "GlobalFlag", 0, REG_DWORD, (BYTE *)&flags, sizeof(flags) );
+
+    memset( &startup, 0, sizeof(startup) );
+    startup.cb = sizeof(startup);
+
+    sprintf( buffer, "%s heap.c 0x%x", argv0, flags );
+    ret = CreateProcessA( NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info );
+    ok( ret, "failed to create child process error %u\n", GetLastError() );
+    if (ret)
+    {
+        winetest_wait_child_process( info.hProcess );
+        CloseHandle( info.hThread );
+        CloseHandle( info.hProcess );
+    }
+    RegDeleteValueA( hkey, "GlobalFlag" );
+    RegCloseKey( hkey );
+    RegDeleteKeyA( HKEY_LOCAL_MACHINE, keyname );
+}
+
+static DWORD heap_flags_from_global_flag( DWORD flag )
+{
+    DWORD ret = 0;
+
+    if (flag & FLG_HEAP_ENABLE_TAIL_CHECK)
+        ret |= HEAP_TAIL_CHECKING_ENABLED;
+    if (flag & FLG_HEAP_ENABLE_FREE_CHECK)
+        ret |= HEAP_FREE_CHECKING_ENABLED;
+    if (flag & FLG_HEAP_VALIDATE_PARAMETERS)
+        ret |= HEAP_VALIDATE_PARAMS | HEAP_VALIDATE | HEAP_TAIL_CHECKING_ENABLED | HEAP_FREE_CHECKING_ENABLED;
+    if (flag & FLG_HEAP_VALIDATE_ALL)
+        ret |= HEAP_VALIDATE_ALL | HEAP_VALIDATE | HEAP_TAIL_CHECKING_ENABLED | HEAP_FREE_CHECKING_ENABLED;
+    if (flag & FLG_HEAP_DISABLE_COALESCING)
+        ret |= HEAP_DISABLE_COALESCE_ON_FREE;
+    if (flag & FLG_HEAP_PAGE_ALLOCS)
+        ret |= HEAP_PAGE_ALLOCS | HEAP_GROWABLE;
+    return ret;
+}
+
+static void test_child_heap( const char *arg )
+{
+    struct heap_layout *heap = GetProcessHeap();
+    DWORD expected = strtoul( arg, 0, 16 );
+    DWORD expect_heap;
+
+    if (expected == 0xdeadbeef)  /* expected value comes from Session Manager global flags */
+    {
+        HKEY hkey;
+        expected = 0;
+        if (!RegOpenKeyA( HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager", &hkey ))
+        {
+            char buffer[32];
+            DWORD type, size = sizeof(buffer);
+
+            if (!RegQueryValueExA( hkey, "GlobalFlag", 0, &type, (BYTE *)buffer, &size ))
+            {
+                if (type == REG_DWORD) expected = *(DWORD *)buffer;
+                else if (type == REG_SZ) expected = strtoul( buffer, 0, 16 );
+            }
+            RegCloseKey( hkey );
+        }
+    }
+    if (expected && !pRtlGetNtGlobalFlags())  /* not working on NT4 */
+    {
+        win_skip( "global flags not set\n" );
+        return;
+    }
+
+    ok( pRtlGetNtGlobalFlags() == expected,
+        "%s: got global flags %08x expected %08x\n", arg, pRtlGetNtGlobalFlags(), expected );
+
+    expect_heap = heap_flags_from_global_flag( expected );
+
+    if (!(heap->flags & HEAP_GROWABLE) || heap->pattern == 0xffeeffee)  /* vista layout */
+    {
+        ok( heap->flags == 0, "%s: got heap flags %08x expected 0\n", arg, heap->flags );
+    }
+    else if (heap->pattern == 0xeeeeeeee && heap->flags == 0xeeeeeeee)
+    {
+        ok( expected & FLG_HEAP_PAGE_ALLOCS, "%s: got heap flags 0xeeeeeeee without page alloc\n", arg );
+    }
+    else
+    {
+        ok( heap->flags == (expect_heap | HEAP_GROWABLE),
+            "%s: got heap flags %08x expected %08x\n", arg, heap->flags, expect_heap );
+        ok( heap->force_flags == (expect_heap & ~0x18000080),
+            "%s: got heap force flags %08x expected %08x\n", arg, heap->force_flags, expect_heap );
+        expect_heap = heap->flags;
+    }
+
+    test_heap_checks( expect_heap );
+}
+
 START_TEST(heap)
 {
+    int argc;
+    char **argv;
+
+    pRtlGetNtGlobalFlags = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "RtlGetNtGlobalFlags" );
+
+    argc = winetest_get_mainargs( &argv );
+    if (argc >= 3)
+    {
+        test_child_heap( argv[2] );
+        return;
+    }
+
     test_heap();
     test_obsolete_flags();
 
@@ -480,4 +799,20 @@ START_TEST(heap)
     test_sized_HeapReAlloc((1 << 20), (2 << 20));
     test_sized_HeapReAlloc((1 << 20), 1);
     test_HeapQueryInformation();
+
+    if (pRtlGetNtGlobalFlags)
+    {
+        test_debug_heap( argv[0], 0 );
+        test_debug_heap( argv[0], FLG_HEAP_ENABLE_TAIL_CHECK );
+        test_debug_heap( argv[0], FLG_HEAP_ENABLE_FREE_CHECK );
+        test_debug_heap( argv[0], FLG_HEAP_VALIDATE_PARAMETERS );
+        test_debug_heap( argv[0], FLG_HEAP_VALIDATE_ALL );
+        test_debug_heap( argv[0], FLG_POOL_ENABLE_TAGGING );
+        test_debug_heap( argv[0], FLG_HEAP_ENABLE_TAGGING );
+        test_debug_heap( argv[0], FLG_HEAP_ENABLE_TAG_BY_DLL );
+        test_debug_heap( argv[0], FLG_HEAP_DISABLE_COALESCING );
+        test_debug_heap( argv[0], FLG_HEAP_PAGE_ALLOCS );
+        test_debug_heap( argv[0], 0xdeadbeef );
+    }
+    else win_skip( "RtlGetNtGlobalFlags not found, skipping heap debug tests\n" );
 }
index 0745bbc..71629bc 100644 (file)
@@ -17,6 +17,7 @@
        <file>directory.c</file>
        <file>drive.c</file>
        <file>environ.c</file>
+       <file>fiber.c</file>
        <file>file.c</file>
        <file>format_msg.c</file>
        <!-- <file>generated.c</file> -->
index 4cb30a8..906646e 100755 (executable)
@@ -359,6 +359,24 @@ static void testLoadLibraryEx(void)
     ok(GetLastError() == ERROR_FILE_NOT_FOUND ||
        broken(GetLastError() == ERROR_INVALID_HANDLE),  /* nt4 */
        "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
+
+    /* Free the loaded dll when its the first time this dll is loaded
+       in process - First time should pass, second fail */
+    SetLastError(0xdeadbeef);
+    hmodule = LoadLibraryExA("comctl32.dll", NULL, LOAD_LIBRARY_AS_DATAFILE);
+    ok(hmodule != 0, "Expected valid module handle\n");
+
+    SetLastError(0xdeadbeef);
+    ok(FreeLibrary(hmodule),
+       "Expected to be able to free the module, failed with %d\n",
+       GetLastError());
+    SetLastError(0xdeadbeef);
+    ok(!FreeLibrary(hmodule),
+       "Unexpected ability to free the module, failed with %d\n",
+       GetLastError());
+
+    CloseHandle(hmodule);
+
 }
 
 START_TEST(module)
index 1c899c8..be01948 100755 (executable)
@@ -57,6 +57,9 @@ static DWORD (WINAPI *pGetLongPathNameW)(LPWSTR,LPWSTR,DWORD);
 static BOOL  (WINAPI *pNeedCurrentDirectoryForExePathA)(LPCSTR);
 static BOOL  (WINAPI *pNeedCurrentDirectoryForExePathW)(LPCWSTR);
 
+static DWORD (WINAPI *pSearchPathA)(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*);
+static DWORD (WINAPI *pSearchPathW)(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*);
+
 /* a structure to deal with wine todos somewhat cleanly */
 typedef struct {
   DWORD shortlen;
@@ -420,6 +423,7 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive)
 static void test_CurrentDirectoryA(CHAR *origdir, CHAR *newdir)
 {
   CHAR tmpstr[MAX_PATH],tmpstr1[MAX_PATH];
+  char *buffer;
   DWORD len,len1;
 /* Save the original directory, so that we can return to it at the end
    of the test
@@ -434,6 +438,45 @@ static void test_CurrentDirectoryA(CHAR *origdir, CHAR *newdir)
   ok(len1==len+1, "GetCurrentDirectoryA returned %d instead of %d\n",len1,len+1);
   ok(lstrcmpiA(tmpstr,"aaaaaaa")==0,
      "GetCurrentDirectoryA should not have modified the buffer\n");
+
+  buffer = HeapAlloc( GetProcessHeap(), 0, 2 * 65536 );
+  SetLastError( 0xdeadbeef );
+  strcpy( buffer, "foo" );
+  len = GetCurrentDirectoryA( 32767, buffer );
+  ok( len != 0 && len < MAX_PATH, "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() );
+  if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer );
+  SetLastError( 0xdeadbeef );
+  strcpy( buffer, "foo" );
+  len = GetCurrentDirectoryA( 32768, buffer );
+  ok( len != 0 && len < MAX_PATH, "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() );
+  if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer );
+  SetLastError( 0xdeadbeef );
+  strcpy( buffer, "foo" );
+  len = GetCurrentDirectoryA( 65535, buffer );
+  ok( (len != 0 && len < MAX_PATH) || broken(!len), /* nt4, win2k, xp */ "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() );
+  if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer );
+  SetLastError( 0xdeadbeef );
+  strcpy( buffer, "foo" );
+  len = GetCurrentDirectoryA( 65536, buffer );
+  ok( (len != 0 && len < MAX_PATH) || broken(!len), /* nt4 */ "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() );
+  if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer );
+  SetLastError( 0xdeadbeef );
+  strcpy( buffer, "foo" );
+  len = GetCurrentDirectoryA( 2 * 65536, buffer );
+  ok( (len != 0 && len < MAX_PATH) || broken(!len), /* nt4 */ "GetCurrentDirectoryA failed %u err %u\n", len, GetLastError() );
+  if (len) ok( !strcmp( buffer, origdir ), "wrong result %s\n", buffer );
+  HeapFree( GetProcessHeap(), 0, buffer );
+
+/* Check for crash prevention on swapped args. Crashes all but Win9x.
+*/
+  if (0)
+  {
+    SetLastError( 0xdeadbeef );
+    len = GetCurrentDirectoryA( 42, (LPSTR)(MAX_PATH + 42) );
+    ok( len == 0 && GetLastError() == ERROR_INVALID_PARAMETER,
+        "GetCurrentDirectoryA failed to fail %u err %u\n", len, GetLastError() );
+  }
+
 /* SetCurrentDirectoryA shouldn't care whether the string has a
    trailing '\\' or not
 */
@@ -1323,6 +1366,12 @@ static void test_GetWindowsDirectory(void)
 
 static void test_NeedCurrentDirectoryForExePathA(void)
 {
+    if (!pNeedCurrentDirectoryForExePathA)
+    {
+        win_skip("NeedCurrentDirectoryForExePathA is not available\n");
+        return;
+    }
+
     /* Crashes in Windows */
     if (0)
         ok(pNeedCurrentDirectoryForExePathA(NULL), "returned FALSE for NULL\n");
@@ -1344,6 +1393,12 @@ static void test_NeedCurrentDirectoryForExePathW(void)
     const WCHAR fullpath[] = {'c', ':', '\\', 0};
     const WCHAR cmdname[] = {'c', 'm', 'd', '.', 'e', 'x', 'e', 0};
 
+    if (!pNeedCurrentDirectoryForExePathW)
+    {
+        win_skip("NeedCurrentDirectoryForExePathW is not available\n");
+        return;
+    }
+
     /* Crashes in Windows */
     if (0)
         ok(pNeedCurrentDirectoryForExePathW(NULL), "returned FALSE for NULL\n");
@@ -1444,19 +1499,95 @@ static void test_drive_letter_case(void)
 #undef is_upper_case_letter
 }
 
+static void test_SearchPathA(void)
+{
+    CHAR pathA[MAX_PATH], fileA[] = "", buffA[MAX_PATH];
+    CHAR *ptrA = NULL;
+    DWORD ret;
+
+    if (!pSearchPathA)
+    {
+        win_skip("SearchPathA isn't available\n");
+        return;
+    }
+
+    GetWindowsDirectoryA(pathA, sizeof(pathA)/sizeof(CHAR));
+
+    /* NULL filename */
+    SetLastError(0xdeadbeef);
+    ret = pSearchPathA(pathA, NULL, NULL, sizeof(buffA)/sizeof(CHAR), buffA, &ptrA);
+    ok(ret == 0, "Expected failure, got %d\n", ret);
+    ok(GetLastError() == ERROR_INVALID_PARAMETER,
+      "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError());
+
+    /* empty filename */
+    SetLastError(0xdeadbeef);
+    ret = pSearchPathA(pathA, fileA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, &ptrA);
+    ok(ret == 0, "Expected failure, got %d\n", ret);
+    ok(GetLastError() == ERROR_INVALID_PARAMETER ||
+       broken(GetLastError() == ERROR_FILE_NOT_FOUND) /* win9x */,
+      "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError());
+}
+
+static void test_SearchPathW(void)
+{
+    WCHAR pathW[MAX_PATH], fileW[] = { 0 }, buffW[MAX_PATH];
+    WCHAR *ptrW = NULL;
+    DWORD ret;
+
+    if (!pSearchPathW)
+    {
+        win_skip("SearchPathW isn't available\n");
+        return;
+    }
+
+    /* SearchPathW is a stub on win9x and doesn't return sane error,
+       so quess if it's implemented indirectly */
+    SetLastError(0xdeadbeef);
+    GetWindowsDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR));
+    if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+    {
+        win_skip("SearchPathW not implemented\n");
+        return;
+    }
+
+if (0)
+{
+    /* NULL filename, crashes on nt4 */
+    SetLastError(0xdeadbeef);
+    ret = pSearchPathW(pathW, NULL, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, &ptrW);
+    ok(ret == 0, "Expected failure, got %d\n", ret);
+    ok(GetLastError() == ERROR_INVALID_PARAMETER,
+       "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError());
+}
+
+    /* empty filename */
+    SetLastError(0xdeadbeef);
+    ret = pSearchPathW(pathW, fileW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, &ptrW);
+    ok(ret == 0, "Expected failure, got %d\n", ret);
+    ok(GetLastError() == ERROR_INVALID_PARAMETER,
+      "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError());
+}
+
+static void init_pointers(void)
+{
+    HMODULE hKernel32 = GetModuleHandleA("kernel32.dll");
+
+#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hKernel32, #f))
+    MAKEFUNC(GetLongPathNameA);
+    MAKEFUNC(GetLongPathNameW);
+    MAKEFUNC(NeedCurrentDirectoryForExePathA);
+    MAKEFUNC(NeedCurrentDirectoryForExePathW);
+    MAKEFUNC(SearchPathA);
+    MAKEFUNC(SearchPathW);
+#undef MAKEFUNC
+}
+
 START_TEST(path)
 {
     CHAR origdir[MAX_PATH],curdir[MAX_PATH], curDrive, otherDrive;
-    pGetLongPathNameA = (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"),
-                                               "GetLongPathNameA" );
-    pGetLongPathNameW = (void*)GetProcAddress(GetModuleHandleA("kernel32.dll") ,
-                                               "GetLongPathNameW" );
-    pNeedCurrentDirectoryForExePathA =
-        (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"),
-                               "NeedCurrentDirectoryForExePathA" );
-    pNeedCurrentDirectoryForExePathW =
-        (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"),
-                               "NeedCurrentDirectoryForExePathW" );
+
+    init_pointers();
 
     /* Report only once */
     if (!pGetLongPathNameA)
@@ -1474,13 +1605,9 @@ START_TEST(path)
     test_GetShortPathNameW();
     test_GetSystemDirectory();
     test_GetWindowsDirectory();
-    if (pNeedCurrentDirectoryForExePathA)
-    {
-        test_NeedCurrentDirectoryForExePathA();
-    }
-    if (pNeedCurrentDirectoryForExePathW)
-    {
-        test_NeedCurrentDirectoryForExePathW();
-    }
+    test_NeedCurrentDirectoryForExePathA();
+    test_NeedCurrentDirectoryForExePathW();
     test_drive_letter_case();
+    test_SearchPathA();
+    test_SearchPathW();
 }
index 36c86e2..7b5ac75 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Unit test suite for CreateProcess function.
+ * Unit test suite for process functions
  *
  * Copyright 2002 Eric Pouech
  * Copyright 2006 Dmitry Timoshkov
index 7410675..a2c02c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Unit test suite for environment functions.
+ * Unit test suite for resource functions.
  *
  * Copyright 2006 Mike McCormack
  *
index 3dd54af..0102ea7 100755 (executable)
@@ -20,6 +20,7 @@ extern void func_console(void);
 extern void func_directory(void);
 extern void func_drive(void);
 extern void func_environ(void);
+extern void func_fiber(void);
 extern void func_file(void);
 extern void func_format_msg(void);
 extern void func_heap(void);
@@ -55,6 +56,7 @@ const struct test winetest_testlist[] =
     { "directory", func_directory },
     { "drive", func_drive },
     { "environ", func_environ },
+       { "fiber", func_fiber },
     { "file", func_file },
     { "format_msg", func_format_msg },
     { "heap", func_heap },
index 275f6aa..69203fe 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Unit test suite for directory functions.
+ * Unit test suite for thread functions.
  *
  * Copyright 2002 Geoffrey Hausheer
  *
 # endif
 #endif
 
-typedef BOOL (WINAPI *GetThreadPriorityBoost_t)(HANDLE,PBOOL);
-static GetThreadPriorityBoost_t pGetThreadPriorityBoost=NULL;
-
-typedef HANDLE (WINAPI *OpenThread_t)(DWORD,BOOL,DWORD);
-static OpenThread_t pOpenThread=NULL;
-
-typedef BOOL (WINAPI *QueueUserWorkItem_t)(LPTHREAD_START_ROUTINE,PVOID,ULONG);
-static QueueUserWorkItem_t pQueueUserWorkItem=NULL;
-
-typedef DWORD (WINAPI *SetThreadIdealProcessor_t)(HANDLE,DWORD);
-static SetThreadIdealProcessor_t pSetThreadIdealProcessor=NULL;
-
-typedef BOOL (WINAPI *SetThreadPriorityBoost_t)(HANDLE,BOOL);
-static SetThreadPriorityBoost_t pSetThreadPriorityBoost=NULL;
-
-typedef BOOL (WINAPI *RegisterWaitForSingleObject_t)(PHANDLE,HANDLE,WAITORTIMERCALLBACK,PVOID,ULONG,ULONG);
-static RegisterWaitForSingleObject_t pRegisterWaitForSingleObject=NULL;
-
-typedef BOOL (WINAPI *UnregisterWait_t)(HANDLE);
-static UnregisterWait_t pUnregisterWait=NULL;
+static BOOL (WINAPI *pGetThreadPriorityBoost)(HANDLE,PBOOL);
+static HANDLE (WINAPI *pOpenThread)(DWORD,BOOL,DWORD);
+static BOOL (WINAPI *pQueueUserWorkItem)(LPTHREAD_START_ROUTINE,PVOID,ULONG);
+static DWORD (WINAPI *pSetThreadIdealProcessor)(HANDLE,DWORD);
+static BOOL (WINAPI *pSetThreadPriorityBoost)(HANDLE,BOOL);
+static BOOL (WINAPI *pRegisterWaitForSingleObject)(PHANDLE,HANDLE,WAITORTIMERCALLBACK,PVOID,ULONG,ULONG);
+static BOOL (WINAPI *pUnregisterWait)(HANDLE);
+static BOOL (WINAPI *pIsWow64Process)(HANDLE,PBOOL);
+static BOOL (WINAPI *pSetThreadErrorMode)(DWORD,PDWORD);
+static DWORD (WINAPI *pGetThreadErrorMode)(void);
+static DWORD (WINAPI *pRtlGetThreadErrorMode)(void);
 
 static HANDLE create_target_process(const char *arg)
 {
@@ -792,6 +783,9 @@ static VOID test_thread_processor(void)
    DWORD_PTR processMask,systemMask;
    SYSTEM_INFO sysInfo;
    int error=0;
+   BOOL is_wow64;
+
+   if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE;
 
    sysInfo.dwNumberOfProcessors=0;
    GetSystemInfo(&sysInfo);
@@ -820,12 +814,27 @@ static VOID test_thread_processor(void)
      }
      ok(error!=-1, "SetThreadIdealProcessor failed\n");
 
-     SetLastError(0xdeadbeef);
-     error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1);
-     ok(error==-1,
-        "SetThreadIdealProcessor succeeded with an illegal processor #\n");
-     ok(GetLastError()==ERROR_INVALID_PARAMETER,
-        "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+     if (is_wow64)
+     {
+         SetLastError(0xdeadbeef);
+         error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1);
+         todo_wine
+         ok(error!=-1, "SetThreadIdealProcessor failed for %u on Wow64\n", MAXIMUM_PROCESSORS+1);
+
+         SetLastError(0xdeadbeef);
+         error=pSetThreadIdealProcessor(curthread,65);
+         ok(error==-1, "SetThreadIdealProcessor succeeded with an illegal processor #\n");
+         ok(GetLastError()==ERROR_INVALID_PARAMETER,
+            "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+     }
+     else
+     {
+         SetLastError(0xdeadbeef);
+         error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1);
+         ok(error==-1, "SetThreadIdealProcessor succeeded with an illegal processor #\n");
+         ok(GetLastError()==ERROR_INVALID_PARAMETER,
+            "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+     }
 
      error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS);
      ok(error==0, "SetThreadIdealProcessor returned an incorrect value\n");
@@ -1203,9 +1212,103 @@ static void test_TLS(void)
   cleanup_thread_sync_helpers();
 }
 
+static void test_ThreadErrorMode(void)
+{
+    DWORD oldmode;
+    DWORD mode;
+    DWORD rtlmode;
+    BOOL ret;
+
+    if (!pSetThreadErrorMode || !pGetThreadErrorMode)
+    {
+        win_skip("SetThreadErrorMode and/or GetThreadErrorMode unavailable (added in Windows 7)\n");
+        return;
+    }
+
+    if (!pRtlGetThreadErrorMode) {
+        win_skip("RtlGetThreadErrorMode not available\n");
+        return;
+    }
+
+    oldmode = pGetThreadErrorMode();
+
+    ret = pSetThreadErrorMode(0, &mode);
+    ok(ret, "SetThreadErrorMode failed\n");
+    ok(mode == oldmode,
+       "SetThreadErrorMode returned old mode 0x%x, expected 0x%x\n",
+       mode, oldmode);
+    mode = pGetThreadErrorMode();
+    ok(mode == 0, "GetThreadErrorMode returned mode 0x%x, expected 0\n", mode);
+    rtlmode = pRtlGetThreadErrorMode();
+    ok(rtlmode == 0,
+       "RtlGetThreadErrorMode returned mode 0x%x, expected 0\n", mode);
+
+    ret = pSetThreadErrorMode(SEM_FAILCRITICALERRORS, &mode);
+    ok(ret, "SetThreadErrorMode failed\n");
+    ok(mode == 0,
+       "SetThreadErrorMode returned old mode 0x%x, expected 0\n", mode);
+    mode = pGetThreadErrorMode();
+    ok(mode == SEM_FAILCRITICALERRORS,
+       "GetThreadErrorMode returned mode 0x%x, expected SEM_FAILCRITICALERRORS\n",
+       mode);
+    rtlmode = pRtlGetThreadErrorMode();
+    ok(rtlmode == 0x10,
+       "RtlGetThreadErrorMode returned mode 0x%x, expected 0x10\n", mode);
+
+    ret = pSetThreadErrorMode(SEM_NOGPFAULTERRORBOX, &mode);
+    ok(ret, "SetThreadErrorMode failed\n");
+    ok(mode == SEM_FAILCRITICALERRORS,
+       "SetThreadErrorMode returned old mode 0x%x, expected SEM_FAILCRITICALERRORS\n",
+       mode);
+    mode = pGetThreadErrorMode();
+    ok(mode == SEM_NOGPFAULTERRORBOX,
+       "GetThreadErrorMode returned mode 0x%x, expected SEM_NOGPFAULTERRORBOX\n",
+       mode);
+    rtlmode = pRtlGetThreadErrorMode();
+    ok(rtlmode == 0x20,
+       "RtlGetThreadErrorMode returned mode 0x%x, expected 0x20\n", mode);
+
+    ret = pSetThreadErrorMode(SEM_NOOPENFILEERRORBOX, NULL);
+    ok(ret, "SetThreadErrorMode failed\n");
+    mode = pGetThreadErrorMode();
+    ok(mode == SEM_NOOPENFILEERRORBOX,
+       "GetThreadErrorMode returned mode 0x%x, expected SEM_NOOPENFILEERRORBOX\n",
+       mode);
+    rtlmode = pRtlGetThreadErrorMode();
+    ok(rtlmode == 0x40,
+       "RtlGetThreadErrorMode returned mode 0x%x, expected 0x40\n", rtlmode);
+
+    for (mode = 1; mode; mode <<= 1)
+    {
+        ret = pSetThreadErrorMode(mode, NULL);
+        if (mode & (SEM_FAILCRITICALERRORS |
+                    SEM_NOGPFAULTERRORBOX |
+                    SEM_NOOPENFILEERRORBOX))
+        {
+            ok(ret,
+               "SetThreadErrorMode(0x%x,NULL) failed with error %d\n",
+               mode, GetLastError());
+        }
+        else
+        {
+            DWORD GLE = GetLastError();
+            ok(!ret,
+               "SetThreadErrorMode(0x%x,NULL) succeeded, expected failure\n",
+               mode);
+            ok(GLE == ERROR_INVALID_PARAMETER,
+               "SetThreadErrorMode(0x%x,NULL) failed with %d, "
+               "expected ERROR_INVALID_PARAMETER\n",
+               mode, GLE);
+        }
+    }
+
+    pSetThreadErrorMode(oldmode, NULL);
+}
+
 START_TEST(thread)
 {
    HINSTANCE lib;
+   HINSTANCE ntdll;
    int argc;
    char **argv;
    argc = winetest_get_mainargs( &argv );
@@ -1214,13 +1317,22 @@ START_TEST(thread)
 */
    lib=GetModuleHandleA("kernel32.dll");
    ok(lib!=NULL,"Couldn't get a handle for kernel32.dll\n");
-   pGetThreadPriorityBoost=(GetThreadPriorityBoost_t)GetProcAddress(lib,"GetThreadPriorityBoost");
-   pOpenThread=(OpenThread_t)GetProcAddress(lib,"OpenThread");
-   pQueueUserWorkItem=(QueueUserWorkItem_t)GetProcAddress(lib,"QueueUserWorkItem");
-   pSetThreadIdealProcessor=(SetThreadIdealProcessor_t)GetProcAddress(lib,"SetThreadIdealProcessor");
-   pSetThreadPriorityBoost=(SetThreadPriorityBoost_t)GetProcAddress(lib,"SetThreadPriorityBoost");
-   pRegisterWaitForSingleObject=(RegisterWaitForSingleObject_t)GetProcAddress(lib,"RegisterWaitForSingleObject");
-   pUnregisterWait=(UnregisterWait_t)GetProcAddress(lib,"UnregisterWait");
+   pGetThreadPriorityBoost=(void *)GetProcAddress(lib,"GetThreadPriorityBoost");
+   pOpenThread=(void *)GetProcAddress(lib,"OpenThread");
+   pQueueUserWorkItem=(void *)GetProcAddress(lib,"QueueUserWorkItem");
+   pSetThreadIdealProcessor=(void *)GetProcAddress(lib,"SetThreadIdealProcessor");
+   pSetThreadPriorityBoost=(void *)GetProcAddress(lib,"SetThreadPriorityBoost");
+   pRegisterWaitForSingleObject=(void *)GetProcAddress(lib,"RegisterWaitForSingleObject");
+   pUnregisterWait=(void *)GetProcAddress(lib,"UnregisterWait");
+   pIsWow64Process=(void *)GetProcAddress(lib,"IsWow64Process");
+   pSetThreadErrorMode=(void *)GetProcAddress(lib,"SetThreadErrorMode");
+   pGetThreadErrorMode=(void *)GetProcAddress(lib,"GetThreadErrorMode");
+
+   ntdll=GetModuleHandleA("ntdll.dll");
+   if (ntdll)
+   {
+       pRtlGetThreadErrorMode=(void *)GetProcAddress(ntdll,"RtlGetThreadErrorMode");
+   }
 
    if (argc >= 3)
    {
@@ -1264,4 +1376,5 @@ START_TEST(thread)
    test_QueueUserWorkItem();
    test_RegisterWaitForSingleObject();
    test_TLS();
+   test_ThreadErrorMode();
 }
index 3c3fde7..8c233f0 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Unit test suite for time functions
+ * Unit test suite for timer functions
  *
  * Copyright 2004 Mike McCormack
  *
index 5187a97..f95fdd9 100755 (executable)
@@ -872,13 +872,70 @@ static void test_CreateFileMapping(void)
     CloseHandle( handle );
 }
 
-static void test_BadPtr(void)
+static void test_IsBadReadPtr(void)
 {
-    void *ptr = (void*)1;
-    /* We assume address 1 is not mapped. */
-    ok(IsBadReadPtr(ptr,1),"IsBadReadPtr(1) failed.\n");
-    ok(IsBadWritePtr(ptr,1),"IsBadWritePtr(1) failed.\n");
-    ok(IsBadCodePtr(ptr),"IsBadCodePtr(1) failed.\n");
+    BOOL ret;
+    void *ptr = (void *)0xdeadbeef;
+    char stackvar;
+
+    ret = IsBadReadPtr(NULL, 0);
+    ok(ret == FALSE, "Expected IsBadReadPtr to return FALSE, got %d\n", ret);
+
+    ret = IsBadReadPtr(NULL, 1);
+    ok(ret == TRUE, "Expected IsBadReadPtr to return TRUE, got %d\n", ret);
+
+    ret = IsBadReadPtr(ptr, 0);
+    ok(ret == FALSE, "Expected IsBadReadPtr to return FALSE, got %d\n", ret);
+
+    ret = IsBadReadPtr(ptr, 1);
+    ok(ret == TRUE, "Expected IsBadReadPtr to return TRUE, got %d\n", ret);
+
+    ret = IsBadReadPtr(&stackvar, 0);
+    ok(ret == FALSE, "Expected IsBadReadPtr to return FALSE, got %d\n", ret);
+
+    ret = IsBadReadPtr(&stackvar, sizeof(char));
+    ok(ret == FALSE, "Expected IsBadReadPtr to return FALSE, got %d\n", ret);
+}
+
+static void test_IsBadWritePtr(void)
+{
+    BOOL ret;
+    void *ptr = (void *)0xdeadbeef;
+    char stackval;
+
+    ret = IsBadWritePtr(NULL, 0);
+    ok(ret == FALSE, "Expected IsBadWritePtr to return FALSE, got %d\n", ret);
+
+    ret = IsBadWritePtr(NULL, 1);
+    ok(ret == TRUE, "Expected IsBadWritePtr to return TRUE, got %d\n", ret);
+
+    ret = IsBadWritePtr(ptr, 0);
+    ok(ret == FALSE, "Expected IsBadWritePtr to return FALSE, got %d\n", ret);
+
+    ret = IsBadWritePtr(ptr, 1);
+    ok(ret == TRUE, "Expected IsBadWritePtr to return TRUE, got %d\n", ret);
+
+    ret = IsBadWritePtr(&stackval, 0);
+    ok(ret == FALSE, "Expected IsBadWritePtr to return FALSE, got %d\n", ret);
+
+    ret = IsBadWritePtr(&stackval, sizeof(char));
+    ok(ret == FALSE, "Expected IsBadWritePtr to return FALSE, got %d\n", ret);
+}
+
+static void test_IsBadCodePtr(void)
+{
+    BOOL ret;
+    void *ptr = (void *)0xdeadbeef;
+    char stackval;
+
+    ret = IsBadCodePtr(NULL);
+    ok(ret == TRUE, "Expected IsBadCodePtr to return TRUE, got %d\n", ret);
+
+    ret = IsBadCodePtr(ptr);
+    ok(ret == TRUE, "Expected IsBadCodePtr to return TRUE, got %d\n", ret);
+
+    ret = IsBadCodePtr((void *)&stackval);
+    ok(ret == FALSE, "Expected IsBadCodePtr to return FALSE, got %d\n", ret);
 }
 
 static void test_write_watch(void)
@@ -1220,6 +1277,8 @@ START_TEST(virtual)
     test_MapViewOfFile();
     test_NtMapViewOfSection();
     test_CreateFileMapping();
-    test_BadPtr();
+    test_IsBadReadPtr();
+    test_IsBadWritePtr();
+    test_IsBadCodePtr();
     test_write_watch();
 }
index efd74d5..f94d9cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Unit test suite
+ * Unit test suite for volume functions
  *
  * Copyright 2006 Stefan Leichter
  *