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

mingw: use CreateHardLink directly #1334

Merged
merged 1 commit into from
Oct 28, 2017

Conversation

max630
Copy link

@max630 max630 commented Oct 26, 2017

It was observed that the current implementation of of get_proc_addr()
fails to load the kernel32.dll with code ERROR_INVALID_PARAMETER.
Probably the reason is that kernel32.dll is already loaded. The
behavior was seen at Windows SP1, both 32bit and 64bit. Probably it
would behave same way in some or all other Windows versions.

This breaks all usages of "clone --local", including the automatic
tests where they call it.

The function CreateHardLink is available in all supported Windows
versions (since Windows XP), so there is no more need to resolve it
in runtime.

@max630
Copy link
Author

max630 commented Oct 26, 2017

The upstream has some older version of this which would conflict, I'll submit the cleanup there as well

compat/mingw.c Outdated
@@ -2,6 +2,7 @@
#include "win32.h"
#include <conio.h>
#include <wchar.h>
#include <windows.h>

This comment was marked as off-topic.

@dscho
Copy link
Member

dscho commented Oct 27, 2017

Thank you!

As I pointed out, this should compile correctly without the extra #include <windows.h>. Would you mind testing and updating the PR as appropriate?

Thanks!

@dscho
Copy link
Member

dscho commented Oct 27, 2017

Oh, and if you could sign off on the patch? I need that to be able to submit this same patch upstream after cooking it in Git for Windows for a while.

@max630 max630 force-pushed the mingw-direct-CreateHardLinkW branch from 9ac5f33 to 99f0c95 Compare October 27, 2017 16:47
It was observed that the current implementation of of get_proc_addr()
fails to load the kernel32.dll with code ERROR_INVALID_PARAMETER.
Probably the reason is that kernel32.dll is already loaded. The
behavior was seen at Windows SP1, both 32bit and 64bit. Probably it
would behave same way in some or all other Windows versions.

This breaks all usages of "clone --local", including the automatic
tests where they call it.

The function CreateHardLink is available in all supported Windows
versions (since Windows XP), so there is no more need to resolve it
in runtime.

Signed-off-by: Max Kirillov <max@max630.net>
@max630 max630 force-pushed the mingw-direct-CreateHardLinkW branch from 99f0c95 to e9630ae Compare October 27, 2017 16:48
@max630
Copy link
Author

max630 commented Oct 27, 2017

I have updated the commit. It build and passes at least some tests. Runnig full suite now but I expect it to be ok

@dscho dscho merged commit 07f905c into git-for-windows:master Oct 28, 2017
@dscho
Copy link
Member

dscho commented Oct 28, 2017

Perfect, thanks!

dscho added a commit that referenced this pull request Oct 30, 2017
dscho added a commit that referenced this pull request Nov 1, 2017
dscho added a commit that referenced this pull request Nov 6, 2017
git-for-windows-ci pushed a commit that referenced this pull request Nov 7, 2017
dscho added a commit that referenced this pull request Nov 29, 2017
git-for-windows-ci pushed a commit that referenced this pull request Dec 6, 2017
dscho added a commit that referenced this pull request Jan 2, 2018
dscho added a commit that referenced this pull request Jan 18, 2018
git-for-windows-ci pushed a commit that referenced this pull request Jan 20, 2018
git-for-windows-ci pushed a commit that referenced this pull request Jan 22, 2018
git-for-windows-ci pushed a commit that referenced this pull request Jan 22, 2018
dscho added a commit that referenced this pull request Jan 22, 2018
dscho added a commit that referenced this pull request Feb 16, 2018
dscho added a commit that referenced this pull request Mar 23, 2018
dscho added a commit that referenced this pull request Apr 3, 2018
dscho added a commit that referenced this pull request May 29, 2018
dscho added a commit that referenced this pull request May 29, 2018
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
…teHardLinkW

mingw: use CreateHardLink directly
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
…teHardLinkW

mingw: use CreateHardLink directly
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
…teHardLinkW

mingw: use CreateHardLink directly
dscho added a commit that referenced this pull request Aug 22, 2018
dscho added a commit to dscho/git that referenced this pull request Aug 22, 2018
…teHardLinkW

mingw: use CreateHardLink directly
dscho added a commit that referenced this pull request Aug 23, 2018
dscho added a commit that referenced this pull request Aug 23, 2018
dscho added a commit that referenced this pull request Aug 23, 2018
jamill pushed a commit to jamill/git that referenced this pull request Aug 28, 2018
…teHardLinkW

mingw: use CreateHardLink directly
jamill pushed a commit to jamill/git that referenced this pull request Sep 5, 2018
…teHardLinkW

mingw: use CreateHardLink directly
git-for-windows-ci pushed a commit that referenced this pull request Sep 10, 2018
jamill pushed a commit to jamill/git that referenced this pull request Sep 11, 2018
…teHardLinkW

mingw: use CreateHardLink directly
git-for-windows-ci pushed a commit that referenced this pull request Sep 24, 2018
dscho added a commit that referenced this pull request Oct 10, 2018
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