[Bug 46635] git for windows works or crashes depending on how its invoked

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Mar 6 14:55:20 CST 2019


https://bugs.winehq.org/show_bug.cgi?id=46635

--- Comment #5 from Louis Lenders <xerox.xerox2000x at gmail.com> ---
Created attachment 63806
  --> https://bugs.winehq.org/attachment.cgi?id=63806
hack

Attached is a hack, stolen from bug 45645, and a bit adapted for this crash.
(that previous hack was utterly wrong, got confused by msdn page that only
states two enumerationtypes (ObjectBasicInformation,ObjectTypeInformation)

To me looks like bug 45645 and this one are more or less similar issues but i`m
by far an expert, so don`t shoot me if i`m wrong, 

I will link this bugreport to bug 45645.

Note: source code seems to be here :
https://github.com/git-for-windows/git/blob/master/compat/winansi.c

typedef struct _OBJECT_NAME_INFORMATION
{
    UNICODE_STRING Name;
    WCHAR NameBuffer[0];
} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;

#define ObjectNameInformation 1

#else
#include <ntstatus.h>
#endif

static void detect_msys_tty(int fd)
{
    ULONG result;
    BYTE buffer[1024];
    POBJECT_NAME_INFORMATION nameinfo = (POBJECT_NAME_INFORMATION) buffer;
    PWSTR name;

    /* check if fd is a pipe */
    HANDLE h = (HANDLE) _get_osfhandle(fd);
    if (GetFileType(h) != FILE_TYPE_PIPE)
        return;

    /* get pipe name */
    if (!NT_SUCCESS(NtQueryObject(h, ObjectNameInformation,
            buffer, sizeof(buffer) - 2, &result)))
        return;
    name = nameinfo->Name.Buffer;
name[nameinfo->Name.Length / sizeof(*name)] = 0;

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list