Skip to content

Conversation

@diversenok
Copy link
Contributor

This pull request updates the definition for NtUserOpenClipboard to reflect that the syscall writes to a pointer provided in the second argument. OpenClipboard passes an address of a local variable to this parameter and then reads from it, causing the following warning:

Error #1: UNINITIALIZED READ: reading 0x00000092296ff998-0x00000092296ff99c 4 byte(s)
# 0 USER32.dll!OpenClipboard
# 1 main                        
Note: @0:00:00.082 in thread 11352
Note: instruction: cmp    0x38(%rsp) $0x00000000

Similar changes would apply to the following files in the dynamorio submodule; not sure if you want me to create a separate pull request to address that:

dynamorio\ext\drsyscall\table_windows_ntuser.c
dynamorio\ext\drmf\wininc\ntuser.h

Copy link
Contributor

@derekbruening derekbruening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

Unfortunately the tests may have issues due to Github dropping support for the Linux and Windows VM versions used...but should be good to merge.

{3, sizeof(LONG), SYSARG_INLINED, DRSYS_TYPE_SIGNED_INT},
}
},
{{0,0},"NtUserOpenClipboard", OK, SYSARG_TYPE_BOOL32, 2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar changes would apply to the following files in the dynamorio submodule; not sure if you want me to create a separate pull request to address that:
dynamorio\ext\drsyscall\table_windows_ntuser.c
dynamorio\ext\drmf\wininc\ntuser.h

Yes, we will need the same changes there, as DynamoRIO/dynamorio#7303 did not yet remove drsyscall from drmemory/ (note to @ivankyluk) and the dynamorio/ copy is what is used outside of drmemory now.

derekbruening pushed a commit to DynamoRIO/dynamorio that referenced this pull request Jul 1, 2025
This pull request updates the definition for `NtUserOpenClipboard`. For
more details, see DynamoRIO/drmemory#2558
@derekbruening derekbruening merged commit 82fb346 into DynamoRIO:master Jul 1, 2025
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants