C# aaApi_Login3 with federated IMS accounts. how to register callback

I'm having trouble getting the aaApi_Login3 api to work.

I'm pretty sure its with the callback to get the IMS user id because I'm not really familiar with that.

here is my api calls and delegate for the callback (note my API wrappers and delegate are in a c# dll which I referenced.

        [DllImport("c:\\Program Files\\Bentley\\ProjectWise\\bin\\dmscli.dll")]
        public static extern bool aaApi_Login3(int lDsType, string lpctstrDSource, string lpctstrUser, string  lpctstrPassword, string lpctstrSchema, ref Guid lpcImsUserId);
        
        [DllImport("c:\\Program Files\\Bentley\\ProjectWise\\bin\\dmscli.dll")]
        public static extern void aaApi_RegisterImsUserIdCallback(AAPROC_IMSUSERIDCALLBACK fnCallback);
        
        public delegate Guid AAPROC_IMSUSERIDCALLBACK();

then I did this for calling it

        //..previous code cut off
            //register IMSUserIDcallback
            PWWrappers.AAPROC_IMSUSERIDCALLBACK IMScallback = new PWWrappers.AAPROC_IMSUSERIDCALLBACK(mycallback);
            PWWrappers.aaApi_RegisterImsUserIdCallback(IMScallback);
            //try to log in
            bool isloggedin = PWWrappers.aaApi_Login3(0, "[DatasourceNameHere]", null, null, null, ref userIMS);
        //..code cut off
        

and I made a mycallback method to use in code above..but I'm I don't think I'm doing this right

       public static Guid mycallback()
        {
            return new Guid();
        }

when I run the code the the aaApi_Login3 returns false.

I'm at a loss for how to get this working