0

I'm trying to reproduce a Visual Studio build without using Visual Studio, and so far I've been able to find where all headers are stored (Windows SDK ones, Visual Studio ones, etc.), thanks to questions like this.

However, there is a specific definition from the Microsoft Cryptography API that I find nowhere:

BCRYPT_HASH_FUNCTION_TABLE

Even googling around for #define BCRYPT_HASH_FUNCTION_TABLE or typedef * BCRYPT_HASH_FUNCTION_TABLE gives no results.

My VS project uses that definition, and VS compiles it, so it manages to find the definition for that type. However, I could not find it in any of the included directories as indicated by the linked SO question, so I see two possibilities:

  1. There are additional include directories which I'm not aware of;
  2. MSVC has some built-in definitions for CNG-related types.

If it's the former, how could I find these additional directories?

I did find a bcrypt.h file in my SDK include directory, which contains several bcrypt-related definitions, but not this specific typedef.

Extra details:

  • The only file named bcrypt.h in my disk is the one I got from installing Windows SDK 7, and it has no such definition;
  • I found another version of bcrypt.h online which does define it, but I don't know which version this is, how could I get it myself, and overall, how does MSVC compile my file with a header that does not include such definition.
Community
  • 1
  • 1
anol
  • 8,264
  • 3
  • 34
  • 78
  • 1
    If that program compiles then it is using the CNG SDK. Pretty hard to get today, all the links are dead. You'll have to find it back on your machine. Look at the compiler's Additional Include Directories setting for a cue. – Hans Passant Apr 30 '16 at 15:15

2 Answers2

1

This question is pretty old, but for future reference:

When using the CNG SDK provided by Microsoft, the kit comes with an Include directory that has all the relevant header files. The full path on my machine is:

C:\Program Files (x86)\Windows Kits\10\Cryptographic Provider Development Kit\Include

To answer your specific question, BCRYPT_HASH_FUNCTION_TABLE is defined in the bcrypt_provider header of that folder (rather than in the bcrypt header).

tdbhacks
  • 26
  • 2
0

If it compiles, but is not defined, then it is not used.

It may be in a section that is #ifdef'd out so you see it but it is not used/compiled.

Paul Ogilvie
  • 25,048
  • 4
  • 23
  • 41
  • Sorry, I edited the question to clarify what I mean: the definition *is* used, but I can't find where it is included by VS, or if it's some sort of VS built-in. – anol Apr 29 '16 at 11:16