Partager via


LoaderVerifierGetHash (Compact 2013)

3/28/2014

The function returns a hash value for the given file.

Syntax

HRESULT LoaderVerifierGetHash(
    __in HANDLE                    hslauthnFile,
    __in_opt LPCWSTR               pszHashAlgorithm,
    __in_bcount_opt(cbHash) BYTE*  pbHash,
    __in DWORD                     cbHash,
    __out_opt DWORD*               pcbHash,
    __deref_opt_out LPWSTR*        ppszHashAlgorithm
);

Parameters

  • pszHashAlgorithm
    [in] Pointer to the algorithm identifier for the hash algorithm that returns the hash value. If this parameter is NULL, the loader uses a default hash algorithm. To retrieve the hash calculated with a specific algorithm, specify the algorithm by using a non-NULL value for the szHashHint parameter in the call to LoaderVerifierAuthenticateFile.
  • pbHash
    [in] Pointer to a variable that receives the hash value for the file. This parameter can be NULL.
  • cbHash
    [in] Variable that specifies the size, in bytes, of the buffer that pbHash points to. This parameter is ignored if pbHash is NULL.
  • pcbHash
    [out] Pointer to a variable that receives the required size of the pbHash buffer, in bytes, when the function exits. This parameter can be NULL if pbHash is not NULL.
  • ppszHashAlgorithm
    [out] Pointer to a variable that receives the algorithm identifier for the hash algorithm that was used to calculate the hash.

Return Value

The values described in the following table are possible return values. If the function is unsuccessful, it returns a standard error code indicating the cause.

Value

Description

S_OK

The function was successful.

E_HANDLE

The parameter hslauthnFile is invalid.

E_INVALIDARG

One or more parameters have invalid values.

E_POINTER

One or more parameters have invalid pointers.

E_INSUFFICIENTBUFFER

The pbHash buffer is too small.

Requirements

Header

loaderverifier.h

Library

coredll.lib

See Also

Reference

Security Loader Functions
LoaderVerifierAuthenticateFile