I don't know if this is related....
I recently ran into some similar problems with several types of ptrs in
functionlists being bogus...
I traced it down to this little nasty in pkcs11p.h & pkcs11u.h:
#if defined(XP_WIN)
#if defined(_WIN32)
#pragma warning(disable:4103)
#pragma pack(push, cryptoki, 1)
#endif
#endif
The makesystem I was using for my stuff wasn't defining "XP_WIN", so I
didn't get the packing right and all the offsets were messed up relative to
nss3.dll, which did define XP_WIN...
Mozilla guys- this appears to be the only reference to XP_WIN in the public
headers for PKCS11.... any chance it can be redone as just _WIN32 but not
XP_WIN? That might cause other problems... who knows :-)
Mike
---
mike belshe
"pfnus" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I have provided stub implementations for all the pkcs11 ver2.10
> functions
> to be used by netscape, after netscape has successfully execute
> C_GetFunctionList(..), it crashes after exiting
> C_GetFunctionList(...),
> without calling any other of my pkcs11 functions.
>
> I found that netscape couldn't read the memory of my C_Initialize(..)
> since
> the memory area pointed to by my C_Initialize(..) is the same as the
> point where netscape crashes (from assembly code), but i am sure i
> have returned a valid function list pointer back to netscape.
>
> I have tested with my own console program, after i get the function
> list pointer, i can call C_Initialize(..) from my console. But why
> netscape crashed when it tried to call my C_Initialize(..)? as if i
> have returned an invalid pointer.
>
> any help?
>
> Here is how i return my function pointer to netscape:
> file://Global declaration
> CK_FUNCTION_LIST FunctionList;
>
> CK_DEFINE_FUNCTION(CK_RV, C_GetFunctionList)(CK_FUNCTION_LIST_PTR_PTR
> ppFunctionList)
> {
> FunctionList.version.major = 1;
> FunctionList.version.minor = 0;
> FunctionList.C_Initialize = C_Initialize;
>
> .......//all the rest of the pkcs11 functions are here
> .....
> *ppFunctionList = &FunctionList;
> return CKR_OK;
>
>
> }//netscape crashed after this, and i suspect it can't find my valid
> functions pointer to the rest of my functions. I got the valid pointer
> with my console, why netscape couldn't?