How to use CryptFindOIDInfo with Win32::API ?

  • Thread starter Daria Morgendorffer
  • Start date
D

Daria Morgendorffer

Hi, I am VERY sorry for disturbing , but believe me that I've already
spent way too much time with thinking and googling before I dared turn
to you...


In my Perl script I want to use the CryptFindOIDInfo function documented
at
http://msdn.microsoft.com/library/d...en-us/seccrypto/security/cryptfindoidinfo.asp

.. So I typed the code...

use Win32::API;

# Note: for the sake of clarity a union that is part of CRYPT_OID_INFO
# was replaced with a single variable.
Win32::API::Struct->typedef( 'CRYPT_OID_INFO', qw(
DWORD cbSize;
char *pszOID;
char *pwszName;
DWORD dwGroupId;
DWORD dwValue;
DWORD cData;
BYTE *pbData;
));

Win32::API::Type->typedef( 'PCCRYPT_OID_INFO', '*CRYPT_OID_INFO' );

Win32::API->Import('crypt32',
'PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void*
pvKey, DWORD dwGroupId)'
);


This is the whole code, I didn't get any further yet...

The perl interpreter keeps giving me just a cryptic report

Win32::API::parse_prototype: bad prototype 'PCCRYPT_OID_INFO WINAPI
CryptFindOIDInfo(DWORD dwKeyType, void* pvKey, DWORD dwGroupId)' at
C:/Perl/site/lib/Win32/API.pm line 278, <DATA> line 164.


The code in API.pm is not helping much and I don't have idea how to
figure out where is the problem. Can you see it?

Thank you in advance!
 
T

Thomas Kratz

Daria said:
Hi, I am VERY sorry for disturbing , but believe me that I've already
spent way too much time with thinking and googling before I dared turn
to you...


In my Perl script I want to use the CryptFindOIDInfo function documented
at
http://msdn.microsoft.com/library/d...en-us/seccrypto/security/cryptfindoidinfo.asp

. So I typed the code...

use Win32::API;

# Note: for the sake of clarity a union that is part of CRYPT_OID_INFO
# was replaced with a single variable.
Win32::API::Struct->typedef( 'CRYPT_OID_INFO', qw(
DWORD cbSize;
char *pszOID;
char *pwszName;
DWORD dwGroupId;
DWORD dwValue;
DWORD cData;
BYTE *pbData;
));

Win32::API::Type->typedef( 'PCCRYPT_OID_INFO', '*CRYPT_OID_INFO' );

Win32::API->Import('crypt32',
'PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void*
pvKey, DWORD dwGroupId)'
);


This is the whole code, I didn't get any further yet...

The perl interpreter keeps giving me just a cryptic report

Win32::API::parse_prototype: bad prototype 'PCCRYPT_OID_INFO WINAPI
CryptFindOIDInfo(DWORD dwKeyType, void* pvKey, DWORD dwGroupId)' at
C:/Perl/site/lib/Win32/API.pm line 278, <DATA> line 164.


The code in API.pm is not helping much and I don't have idea how to
figure out where is the problem. Can you see it?

Thank you in advance!

I don't think this will be easy. HAve a look here

http://tinyurl.com/fz98k

Thomas

--
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top