# 'SDKERR\_INVALID\_PARAMETER' returned after calling 'CreateAuthService'

**URL:** <https://devforum.zoom.us/t/sdkerr-invalid-parameter-returned-after-calling-createauthservice/70257>\
**Category:** Windows\
**Created:** [June 9, 2022, 4:24pm UTC](https://devforum.zoom.us/t/sdkerr-invalid-parameter-returned-after-calling-createauthservice/70257 "2022-06-09T16:24:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wolf\_Isaac](https://avatars.discourse-cdn.com/v4/letter/w/dec6dc/32.png) [@Wolf\_Isaac](https://devforum.zoom.us/u/Wolf_Isaac)\
**Post date:** [June 9, 2022, 4:24pm UTC](https://devforum.zoom.us/t/sdkerr-invalid-parameter-returned-after-calling-createauthservice/70257/1 "2022-06-09T16:24:45Z")

</div>

**Description**  
I am attempting to import methods from ‘sdk.dll’ so that I may use them in the Unity game engine. I have started implementing ‘AuthService’ which is meant to be a wrapper around ‘ZOOMSDK::IAuthService’. When I call my method ‘CreateAuthService(IntPtr)’ I get the return value SDKERR\_INVALID\_PARAMETER’. I am curious to know if the issue is coming from the parameter I supplied. Am I marshaling it incorrectly?

**Which Windows Meeting SDK version?**  
v5.10.3.4884

**Code Snippet (this is my C# code)**

```auto
using System;
using System.Runtime.InteropServices;
using static ZoomNative;

public class AuthService
{
    [DllImport("sdk.dll", CallingConvention = CallingConvention.Cdecl)]
    private static extern int CreateAuthService(IntPtr authService);
    
    [DllImport("sdk.dll", CallingConvention = CallingConvention.Cdecl)]
    private static extern int DestroyAuthService(IntPtr authService);
    
    private readonly IntPtr _authServicePtr;
    public readonly SDKError createResult;
    public SDKError destructResult { get; private set; }

    public AuthService()
    {
        createResult = (SDKError)CreateAuthService(_authServicePtr);
    }

    ~AuthService()
    {
        destructResult = (SDKError)DestroyAuthService(_authServicePtr);
    }
}

```

**Device:**

- Device: Asus B550
- OS: Windows 10

**Additional Context**  
This is the signature of the method I’m trying to import from c++.

```auto
extern "C"{
SDK_API SDKError CreateAuthService(IAuthService** ppAuthService);
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 10, 2022, 2:25am UTC](https://devforum.zoom.us/t/sdkerr-invalid-parameter-returned-after-calling-createauthservice/70257/2 "2022-07-10T02:25:06Z")

</div>

Closed on July 10, 2022, 2:25am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
