git/t/helper
Matthias Aßhauer 4a9b204920 lazyload: use correct calling conventions
Christoph Reiter reported on the Git for Windows issue tracker[1], that
mingw_strftime() imports strftime() from ucrtbase.dll with the wrong
calling convention. It should be __cdecl instead of WINAPI, which we
always use in DECLARE_PROC_ADDR().

The MSYS2 project encountered cmake sefaults on x86 Windows caused by
the same issue in the cmake source. [2] There are no known git crashes
that where caused by this, yet, but we should try to prevent them.

We import two other non-WINAPI functions via DECLARE_PROC_ADDR(), too.

* NtSetSystemInformation() (NTAPI)
* GetUserNameExW()         (SEC_ENTRY)

NTAPI, SEC_ENTRY and WINAPI are all ususally defined as __stdcall,
but there are circumstances where they're defined differently.

Teach DECLARE_PROC_ADDR() about calling conventions and be explicit
about when we want to use which calling convention.

Import winnt.h for the definition of NTAPI and sspi.h for SEC_ENTRY
near their respective only users.

[1] https://github.com/git-for-windows/git/issues/3560
[2] https://github.com/msys2/MINGW-packages/issues/10152

Reported-By: Christoph Reiter <reiter.christoph@gmail.com>
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-09 10:34:53 -08:00
..
.gitignore
test-advise.c advice.h: add missing __attribute__((format)) & fix usage 2021-07-13 15:20:20 -07:00
test-bitmap.c t/helper/test-bitmap.c: add 'dump-hashes' mode 2021-09-14 16:34:17 -07:00
test-bloom.c Merge branch 'cc/test-helper-bloom-usage-fix' 2021-04-13 15:28:52 -07:00
test-chmtime.c fsmonitor: add perf test for git diff HEAD 2021-03-18 13:31:14 -07:00
test-config.c
test-crontab.c
test-ctype.c
test-date.c
test-delta.c
test-dir-iterator.c
test-drop-caches.c lazyload: use correct calling conventions 2022-01-09 10:34:53 -08:00
test-dump-cache-tree.c
test-dump-fsmonitor.c
test-dump-split-index.c
test-dump-untracked-cache.c environment.c: remove test-specific "ignore_untracked..." variable 2021-09-22 13:15:00 -07:00
test-example-decorate.c lookup_unknown_object(): take a repository argument 2021-04-13 13:18:46 -07:00
test-fake-ssh.c
test-fast-rebase.c fast-rebase: write conflict state to working tree, index, and HEAD 2021-05-20 15:40:39 +09:00
test-genrandom.c
test-genzeros.c
test-getcwd.c t0001: fix broken not-quite getcwd(3) test in bed67874e2 2021-07-30 10:18:27 -07:00
test-hash-speed.c builtins + test helpers: use return instead of exit() in cmd_* 2021-06-09 09:15:58 +09:00
test-hash.c builtins + test helpers: use return instead of exit() in cmd_* 2021-06-09 09:15:58 +09:00
test-hashmap.c
test-index-version.c
test-json-writer.c
test-lazy-init-name-hash.c
test-match-trees.c builtins + test helpers: use return instead of exit() in cmd_* 2021-06-09 09:15:58 +09:00
test-mergesort.c test-mergesort: use repeatable random numbers 2021-10-08 10:04:56 -07:00
test-mktemp.c
test-oid-array.c tests: fix test-oid-array leak, test in SANITIZE=leak 2021-10-07 15:40:15 -07:00
test-oidmap.c
test-oidtree.c tests: fix a memory leak in test-oidtree.c 2021-10-07 15:40:15 -07:00
test-online-cpus.c
test-parse-options.c tests: fix a memory leak in test-parse-options.c 2021-10-07 15:40:15 -07:00
test-parse-pathspec-file.c
test-partial-clone.c promisor-remote: teach lazy-fetch in any repo 2021-06-28 09:58:01 -07:00
test-path-utils.c t0060: test ntfs/hfs-obscured dotfiles 2021-05-04 11:52:02 +09:00
test-pcre2-config.c
test-pkt-line.c test-lib-functions: use test-tool for [de]packetize() 2021-07-19 11:53:50 -07:00
test-prio-queue.c tests: fix a memory leak in test-prio-queue.c 2021-10-07 15:40:15 -07:00
test-proc-receive.c
test-progress.c
test-reach.c builtins + test helpers: use return instead of exit() in cmd_* 2021-06-09 09:15:58 +09:00
test-read-cache.c test-tool: don't force full index 2021-03-30 12:57:46 -07:00
test-read-graph.c
test-read-midx.c test-read-midx: fix leak of bitmap_index struct 2021-10-07 11:01:22 -07:00
test-ref-store.c t/helper/ref-store: initialize oid in resolve-ref 2021-06-02 10:01:54 +09:00
test-regex.c
test-repository.c
test-revision-walking.c
test-run-command.c *.h: move some *_INIT to designated initializers 2021-09-27 14:48:00 -07:00
test-scrap-cache-tree.c
test-serve-v2.c serve.[ch]: remove "serve_options", split up --advertise-refs code 2021-08-05 08:59:37 -07:00
test-sha1.c
test-sha1.sh
test-sha256.c
test-sigchain.c
test-simple-ipc.c t/helper/simple-ipc: convert test-simple-ipc to use start_bg_command 2021-09-20 08:57:58 -07:00
test-strcmp-offset.c
test-string-list.c
test-submodule-config.c
test-submodule-nested-repo-config.c repository: support unabsorbed in repo_submodule_init 2021-09-09 14:09:30 -07:00
test-subprocess.c
test-tool.c Merge branch 'ab/getcwd-test' 2021-08-04 13:28:55 -07:00
test-tool.h Merge branch 'ab/getcwd-test' 2021-08-04 13:28:55 -07:00
test-trace2.c
test-urlmatch-normalization.c
test-userdiff.c userdiff tests: list builtin drivers via test-tool 2021-04-08 12:19:10 -07:00
test-wildmatch.c
test-windows-named-pipe.c
test-write-cache.c
test-xml-encode.c