Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1394 / win / exe: use QueryFullProcessImageNameW to get the exe() #1413

Merged
merged 4 commits into from Feb 17, 2019

Conversation

giampaolo
Copy link
Owner

See #1394.

@giampaolo
Copy link
Owner Author

giampaolo commented Feb 17, 2019

As said in #1394 (comment) this has the drawback of breaking backward compatibility on Win XP. I'm not sure how much time I'm willing to invest into this but roughly I see one solution:

  1. use C pre-processor in order to identify the Windows version and choose the right code path:
#if (_WIN32_WINNT >= 0x0600) // Windows Vista and above
   // new code using QueryFullProcessImageNameW
#else // Windows XP
    // old code using GetProcessImageFileNameW
#endif
  1. implement a similar routine in the python code so that if WINVER < VISTA we use QueryDosDevice to convert the returned path in the right format

@giampaolo
Copy link
Owner Author

giampaolo commented Feb 17, 2019

@ogurets if I land a patch including Win XP support could you please try? (I have no Win XP box to test against)

@giampaolo giampaolo merged commit 7381d4d into master Feb 17, 2019
@giampaolo giampaolo deleted the win-alternate-exe-api branch February 17, 2019 18:15
@ogurets
Copy link

ogurets commented Feb 17, 2019

@giampaolo Sure! Cannot promise I'll be swift though, I'm pretty piled up right now :(

@giampaolo
Copy link
Owner Author

giampaolo commented Feb 17, 2019

No rush. In general terms this is low-priority anyway so I'll forget about it unless pinged here (I was tempted to remove Win XP support, but sort of felt a bit cautious... =)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants