"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dlls/kernel32/tests/toolhelp.c" between
wine-5.12.tar.xz and wine-5.13.tar.xz

About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs. Development release.

toolhelp.c  (wine-5.12.tar.xz):toolhelp.c  (wine-5.13.tar.xz)
skipping to change at line 233 skipping to change at line 233
{ {
found = TRUE; found = TRUE;
break; break;
} }
/* Reset data */ /* Reset data */
thread_traversed[i] = 0; thread_traversed[i] = 0;
} }
ok(found == FALSE, "The thread order is not strictly consistent\n"); ok(found == FALSE, "The thread order is not strictly consistent\n");
/* Determine the order by NtQuerySystemInformation function */ /* Determine the order by NtQuerySystemInformation function */
pcs_buffer = NULL;
status = pNtQuerySystemInformation(SystemProcessInformation, pcs_buffer, buf while ((status = NtQuerySystemInformation(SystemProcessInformation,
_size, &buf_size); pcs_buffer, buf_size, &buf_size)) == STATUS_INFO_LENGTH_MISMATCH)
ok(status == STATUS_INFO_LENGTH_MISMATCH, "Failed with %x\n", status);
if (status == STATUS_INFO_LENGTH_MISMATCH)
{ {
pcs_buffer = HeapAlloc(GetProcessHeap(), 0, buf_size); free(pcs_buffer);
ok(pcs_buffer != NULL, "Unable to allocate space\n"); pcs_buffer = malloc(buf_size);
found = FALSE; }
matched_idx = -1; ok(status == STATUS_SUCCESS, "got %#x\n", status);
found = FALSE;
status = NtQuerySystemInformation(SystemProcessInformation, pcs_buffer, matched_idx = -1;
buf_size, &buf_size);
do {
spi = (SYSTEM_PROCESS_INFORMATION*)&pcs_buffer[pcs_offset];
if (spi->UniqueProcessId == curr_pid)
{
found = TRUE;
break;
}
pcs_offset += spi->NextEntryOffset;
} while (spi->NextEntryOffset != 0);
ok(found && spi, "No process found\n"); do
for (i = 0; i < spi->dwThreadCount; i++) {
spi = (SYSTEM_PROCESS_INFORMATION*)&pcs_buffer[pcs_offset];
if (spi->UniqueProcessId == curr_pid)
{ {
tid = HandleToULong(spi->ti[i].ClientId.UniqueThread); found = TRUE;
if (matched_idx > 0) break;
{
thread_traversed[matched_idx++] = tid;
if (matched_idx >= NUM_THREADS) break;
}
else if (tid == thread_ids[0])
{
matched_idx = 0;
thread_traversed[matched_idx++] = tid;
}
} }
} pcs_offset += spi->NextEntryOffset;
if (pcs_buffer) } while (spi->NextEntryOffset != 0);
HeapFree(GetProcessHeap(), 0, pcs_buffer);
ok(found && spi, "No process found\n");
for (i = 0; i < spi->dwThreadCount; i++)
{
tid = HandleToULong(spi->ti[i].ClientId.UniqueThread);
if (matched_idx > 0)
{
thread_traversed[matched_idx++] = tid;
if (matched_idx >= NUM_THREADS) break;
}
else if (tid == thread_ids[0])
{
matched_idx = 0;
thread_traversed[matched_idx++] = tid;
}
}
free(pcs_buffer);
ok(matched_idx > 0, "No thread id match found\n"); ok(matched_idx > 0, "No thread id match found\n");
found = FALSE; found = FALSE;
for (i = 0; i < NUM_THREADS; i++) for (i = 0; i < NUM_THREADS; i++)
{ {
if (thread_traversed[i] != thread_ids[i]) if (thread_traversed[i] != thread_ids[i])
{ {
found = TRUE; found = TRUE;
break; break;
 End of changes. 5 change blocks. 
37 lines changed or deleted 34 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)