RFR: 8289275: Remove incorrect __declspec(dllimport) attributes from pointers in jdk.crypto.cryptoki
Julian Waters
jwaters at openjdk.org
Tue Jun 28 07:23:05 UTC 2022
Several instances of function pointers in jdk.crypto.cryptoki are marked with the dllimport attribute, which should only be applied to symbol declarations, of which a typedef'd function pointer is not. In addition to being incorrect, at least on the versions of Visual C++ the JDK supports today, it is also redundant; Typically they are used to avoid an indirect stub that jumps to the proper entry in the import address table, but usage of these typedefs involves loading the address of a function and directly (Usually through GetProcAddress, even in other cases it would simply be set to the address of a function anyway) and assigning it to the pointer before immediately dispatching when called, which bypasses this procedure entirely and makes the attribute pointless.
-------------
Commit messages:
- Remove __declspec(dllimport) from pointers
Changes: https://git.openjdk.org/jdk/pull/9304/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9304&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8289275
Stats: 7 lines in 3 files changed: 0 ins; 0 del; 7 mod
Patch: https://git.openjdk.org/jdk/pull/9304.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9304/head:pull/9304
PR: https://git.openjdk.org/jdk/pull/9304
More information about the security-dev
mailing list