One of the exceptions that can be raised by NdrConformantStringBufferSize(..), NdrConformantStringMarshall(..) and others is access violation. You'll need to debug the code to find out exactly which function is raising the exception.