From: Etaash Mathamsetty etaash.mathamsetty@gmail.com
try squashing commits again
fix print formatting
fix potential logic error
fix errors
improve formatting
bcrypt: Fix the non-PE build after ECDH_P384 was added.
This fixes non-PE builds after 5253c8d77e8e7dc5770981e97e67348f393b99b9.
Signed-off-by: Martin Storsjö martin@martin.st
ddraw/tests: Add a comment to note that tests in d3d.c are deprecated.
And new tests should be added to tests/ddraw{1,2,4,7}.c.
ddraw/tests: Move the capability tests for enumerated devices.
Move the capability tests for enumerated devices from d3d.c to ddraw{1,2,4}.c.
ddraw/tests: Add more capability tests for enumerated devices.
Add tests for D3DDEVCAPS_HWTRANSFORMANDLIGHT and D3DDEVCAPS_DRAWPRIMITIVES2EX.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com
ddraw: Don't report unsupported device capabilities in d3d7_EnumDevices().
Fix Battle Realms: Zen Edition failing to start. The game expects to find a device without D3DDEVCAPS_HWTRANSFORMANDLIGHT.
ddraw: Don't report unsupported device capabilities in d3d3_EnumDevices().
winepulse: Adapt "endpoint" struct to mmdevapi's.
winepulse: Adapt "create_stream_params" struct to mmdevapi's.
winepulse: Adapt "release_stream_params" struct to mmdevapi's.
winepulse: Adapt "release_render_buffer_params" struct to mmdevapi's.
winepulse: Adapt "get_capture_buffer_params" struct to mmdevapi's.
winepulse: Adapt "get_mix_format_params" struct to mmdevapi's.
winepulse: Adapt "get_device_period_params" struct to mmdevapi's.
winepulse: Adapt "is_started_params" struct to mmdevapi's.
winepulse: Adapt "get_prop_value_params" struct to mmdevapi's.
winepulse: Switch to mmdevapi's unixlib.h.
server: Use POLLIN instead of POLLPRI if the socket is in oobinline mode.
server: Use check_fd_events() instead of calling poll() directly.
server: Always prefer synchronous I/O in nonblocking mode.
foobar2000.exe's UPnP Media Renderer component (foo_out_upnp.dll) expects that, if a select() call completes successfully with a non-empty writefds set, any immediately following send() call on a socket in the writefds set never fails with WSAEWOULDBLOCK.
On Wine, the Winsock select() and send() implementations both call the Unix poll(2) under the hood to test if I/O is possible on the socket. As it turns out, it's entirely possible that Linux poll() may yield POLLOUT on the first call (by select) but *not* the second (by send), even if no send() call has been made in the meanwhile.
On Linux (as of v5.19), a connected (ESTABLISHED) TCP socket that has not been shut down indicates (E)POLLOUT only if the ratio of sk_wmem_queued (the amount of bytes queued in the send buffer) to sk_sndbuf (the size of send buffer size itself, which can be retrieved via SO_SNDBUF) is below a certain threshold. Therefore, a falling edge in POLLOUT can be triggered due to a number of reasons:
1. TCP fragmentation. Once a TCP packet is split out from a larger sk_buff, it incurs extra bookkeeping overhead (e.g. sk_buff header) that is counted in sk_wmem_queued alongside application data. See also: tcp_fragment(), tso_fragment() (Linux 5.19).
2. Control packets (e.g. MTU probing). Such packets share the same buffer with application-initiated packets, and thus counted in sk_wmem_queued. See also: sk_wmem_queued_add() callers (Linux 5.19).
3. Memory pressure. This causes sk_sndbuf to shrink. See also: sk_stream_moderate_sndbuf() callers (Linux 5.19).
Fix this by always attempting synchronous I/O first if req->force_async is unset and the nonblocking flag is set.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53486
msvcr100: Factor out the mapping of a context to a scheduler.
Signed-off-by: Torge Matthies tmatthies@codeweavers.com
msvcr100: Implement _StructuredTaskCollection::_Schedule and _Schedule_loc.
Signed-off-by: Torge Matthies tmatthies@codeweavers.com
msvcr100: Set scheduler in tasks created with ScheduleTask function.
qasf/tests: Test ASF Reader filter initial state and pins.
qasf/tests: Test ASF Reader filter threading wrt. ReceiveCanBlock.
fix potential logic error
improve formatting --- dlls/ntoskrnl.exe/instr.c | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c index 8f1aa4d45a3..85d48cef7aa 100644 --- a/dlls/ntoskrnl.exe/instr.c +++ b/dlls/ntoskrnl.exe/instr.c @@ -890,7 +890,50 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) } break; /* Unable to emulate it */ } + case 0x38: + case 0x39: /* cmp r/m r/m */ + { + ULONG64 *data = (ULONG64*)INSTR_GetOperandAddr(context, instr + 1, prefixlen + 1, long_addr, rex, segprefix, &len); + ULONG64 *data2 = (ULONG64*)INSTR_GetOperandAddr(context, instr + 2, prefixlen + 2, long_addr, rex, segprefix, &len); + SIZE_T offset = (BYTE*)data - user_shared_data; + SIZE_T offset2 = (BYTE*)data2 - user_shared_data; + SIZE_T data_size = get_op_size(long_op, rex); + BOOL is_user_shared_data = FALSE; + ULONG64 cmp1, cmp2, bitmask; + if(offset <= KSHARED_USER_DATA_PAGE_SIZE - data_size) + { + TRACE("USD offset %#x at %p\n",(unsigned int) offset, (void*) context->Rip); + data = (ULONG64*)(wine_user_shared_data + offset); + is_user_shared_data = TRUE; + } + if(offset2 <= KSHARED_USER_DATA_PAGE_SIZE - data_size) + { + TRACE("USD offset %#x at %p\n", (unsigned int) offset2, (void*) context->Rip); + data2 = (ULONG64*)(wine_user_shared_data + offset2); + is_user_shared_data = TRUE; + } + if(is_user_shared_data) + { + /* clear ZF and CF */ + context->EFlags &= ~(1UL << 6); + context->EFlags &= ~(1UL); + + bitmask = ((1ULL << (8 * data_size)) - 1); + /* FIXME("bitmask %llx\n", bitmask); */
+ cmp1 = (*data) & bitmask; + cmp2 = (*data2) & bitmask; + + if(cmp1 == cmp2) + context->EFlags |= (1UL << 6); /* ZF */ + else if(cmp1 < cmp2) + context->EFlags |= 1UL; /* CF */ + + context->Rip += prefixlen + len + 1; + return ExceptionContinueExecution; + } + break; + } case 0xa0: /* mov Ob, AL */ case 0xa1: /* mov Ovqp, rAX */ {