A Little more help with DllCall / Data Types Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Cuadrix
Posts: 236
Joined: 07 May 2017, 08:26

A Little more help with DllCall / Data Types

23 May 2019, 05:24

Docs:

Code: Select all

BOOL CryptVerifyMessageHash(
  PCRYPT_HASH_MESSAGE_PARA pHashPara,
  BYTE                     *pbHashedBlob,
  DWORD                    cbHashedBlob,
  BYTE                     *pbToBeHashed,
  DWORD                    *pcbToBeHashed,
  BYTE                     *pbComputedHash,
  DWORD                    *pcbComputedHash
);
Autohotkey type for BYTE is UChar. Since the above; BYTE *pbHashedBlob is a pointer to a BYTE, do I just append the suffix * or P to UChar ?

Like UCharP :?:

What about a pointer to a userdefined type with an asetisk?;

Docs:

Code: Select all

PVOID VirtualAlloc2FromApp(
  HANDLE                 Process,
  PVOID                  BaseAddress,
  SIZE_T                 Size,
  ULONG                  AllocationType,
  ULONG                  PageProtection,
  MEM_EXTENDED_PARAMETER *ExtendedParameters,
  ULONG                  ParameterCount
);
For the above; MEM_EXTENDED_PARAMETER *ExtendedParameters do I use PtrP or just Ptr ?

And lastly for now; What about const void* or any other const * ?

Trying to better my understanding on this.
just me
Posts: 9574
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: A Little more help with DllCall / Data Types  Topic is solved

23 May 2019, 07:33

CryptVerifyMessageHash:

Code: Select all

  BYTE                     *pbHashedBlob,
In this case, *pbHashedBlob seems to be a pointer to an array of BYTE/UChars. That's why Ptr fits best.

Code: Select all

DllCall("Crypt32.dll\CryptVerifyMessageHash2, "Ptr", pHashPara, "Ptr", pbHashedBlob, ...)

Code: Select all

  DWORD                    *pcbToBeHashed,
In this case *pcbToBeHashed is a pointer to a DWORD/UInt specifying the size of pbToBeHashed in bytes. If the function writes to pbToBeHashed it updates the value the pointer points to. If you use the * or P suffix, AHK will update the contents of the used variable automatically.

Code: Select all

DllCall("Crypt32.dll\CryptVerifyMessageHash2, "Ptr", pHashPara, "Ptr", pbHashedBlob, "UIntP", cbToBeHashed, ...
just me
Posts: 9574
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: A Little more help with DllCall / Data Types

23 May 2019, 09:43

VirtualAlloc2FromApp:

Code: Select all

  MEM_EXTENDED_PARAMETER *ExtendedParameters,
An optional pointer to one or more extended parameters of type MEM_EXTENDED_PARAMETER.
So it's also a pointer to an array -> Ptr.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Kodakku and 363 guests