From: Jactry Zeng Subject: Re: [PATCH] twain_32: Fix crash by call TWAIN_UserSelect twice. Message-Id: Date: Tue, 1 Jun 2021 22:37:20 +0800 In-Reply-To: <4d544297-969e-da28-ae06-5d138c534519@codeweavers.com> References: <202106012122393190051@uniontech.com> <4d544297-969e-da28-ae06-5d138c534519@codeweavers.com> On 6/1/21 10:27 PM, Jactry Zeng wrote: > On 6/1/21 9:22 PM, Jiajin Cui wrote: >> >> twain_autodetect(); >> >> + if (!IsWindow(parent)) >> + parent = *(HWND*)DSM_parent; >> + > If this is true, you would need to remove the following check. Sorry, please ignore this comment. > And I think attaching some tests to verify it won't hurt.


On 6/1/21 10:27 PM, Jactry Zeng wrote:
On 6/1/21 9:22 PM, Jiajin Cui wrote:
 
     twain_autodetect();
 
+    if (!IsWindow(parent))
+        parent = *(HWND*)DSM_parent;
+
If this is true, you would need to remove the following check.
Sorry, please ignore this comment.
And I think attaching some tests to verify it won't hurt.
-----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEENcHKmsHEqfZUIecDmyjwnocwYPQFAmC2RiAFAwAAAAAACgkQmyjwnocwYPTD rAf+PaYK79U57yOzdmx/29DF3VhHCMnmBKqWaYRUsmsv30OznqEsQa7aQmUSjijvol3uaYzsXdQn aJy9e91xam8fTkUB1Ce0BsQM2+RaWXnCeq17+E0bBfW10zohpbxHRptmqbbbJ4mCOnrcm28g6CO6 wKJzpsUQwhJASgvw12WpHhDh5KCgDDr8io8ELKS1RaSsB03VTGGANq3D13tQR5Uj3i2cBAe/noDX 3fcyScI/29R84FhFUnnVz5/XfP9ye5mit+WHqWuu+Ql9udKFtWN5K3Ch+Z07DEKsMLUlnRBrYWVe hKm/7CkfsQTwwC8GaFWKwnI7HY/xOlj6/5DqluJNtw== =exJo -----END PGP SIGNATURE-----