msvcrt: Do not acquire fd lock in msvcrt_create_io_inherit_block.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51647
Signed-off-by: Doug Lyons <douglyons@douglyons.com>
Signed-off-by: Thomas Faber <thomas.faber@reactos.org>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Doug Lyons 2021-11-11 17:32:45 -05:00 committed by Alexandre Julliard
parent 68b48acbc4
commit 5a514d3f45
2 changed files with 3 additions and 4 deletions

View File

@ -517,7 +517,7 @@ static int msvcrt_init_fp(FILE* file, int fd, unsigned stream_flags)
* 04 char file flags (wxflag): repeated for each fd
* 4+NBFD HANDLE file handle: repeated for each fd
*/
unsigned msvcrt_create_io_inherit_block(WORD *size, BYTE **block)
BOOL msvcrt_create_io_inherit_block(WORD *size, BYTE **block)
{
int fd, last_fd;
char* wxflag_ptr;
@ -543,7 +543,7 @@ unsigned msvcrt_create_io_inherit_block(WORD *size, BYTE **block)
for (fd = 0; fd < last_fd; fd++)
{
/* to be inherited, we need it to be open, and that DONTINHERIT isn't set */
fdinfo = get_ioinfo(fd);
fdinfo = get_ioinfo_nolock(fd);
if ((fdinfo->wxflag & (WX_OPEN | WX_DONTINHERIT)) == WX_OPEN)
{
*wxflag_ptr = fdinfo->wxflag;
@ -554,7 +554,6 @@ unsigned msvcrt_create_io_inherit_block(WORD *size, BYTE **block)
*wxflag_ptr = 0;
*handle_ptr = INVALID_HANDLE_VALUE;
}
release_ioinfo(fdinfo);
wxflag_ptr++; handle_ptr++;
}
return TRUE;

View File

@ -238,7 +238,7 @@ extern void msvcrt_free_concurrency(void) DECLSPEC_HIDDEN;
extern void msvcrt_free_scheduler_thread(void) DECLSPEC_HIDDEN;
#endif
extern unsigned msvcrt_create_io_inherit_block(WORD*, BYTE**) DECLSPEC_HIDDEN;
extern BOOL msvcrt_create_io_inherit_block(WORD*, BYTE**) DECLSPEC_HIDDEN;
/* run-time error codes */
#define _RT_STACK 0