c++ - Converting: #define xxxxxx ((LPCSTR) 4) -
in wincrypt.h see:
#define cert_chain_policy_ssl ((lpcstr) 4) wincrypt32api bool winapi certverifycertificatechainpolicy( in lpcstr pszpolicyoid, in pccert_chain_context pchaincontext, in pcert_chain_policy_para ppolicypara, in out pcert_chain_policy_status ppolicystatus );
the first argument takes cert_chain_policy_ssl. appears pointer c string, yet integer!?
the pointer 32bit integer, pointing at? if number < 255 take single byte, c string in fact single byte "string" (ie byte)?
when conveting language support byte variables, can create bvar (a byte variable) , assign 4. can pass pointer byte variable?
sometimes api take parameter can 'cookie' or id well-known object or pointer name (for example),which appears case here. 4
cookie/handle/id well-known cert_chain_policy_ssl
policy. users of api might specify policy that's not known library ahead of time, specified name can somewhere (or registry, config file or something).
in similar vein, getprocaddress()
can take pointer name of function want address (which how it's used 99% of time today), or pointer-to-a-string parameter can number specifies ordinal of function.
overloading pointer parameters unfortunate techniques that's used make api more flexible. fortunately it's not particularly common.
anyway, if want call api language , specify cert_chain_policy_ssl
policy, need pass 4
pointer's value (not pointer pointing value 4).
Comments
Post a Comment