aaApi_IsUserConnected is documented "This function requires administrative privileges."
is there an alternative method to verify the connection that does not require administrative privileges?
Also, when I do try as administrator, the function always seems to return false.
bool PwLogin::login(PwLoginInfo &info) { const LONG_PTR res = aaApi_LoginDlgExt ( info.hWndParent, info.mTitle, info.ulFlags, info.mDataSource.data(), info.mDataSource.size(), info.mUsername, info.mPassword, info.mSchema ); if (res == IDOK) { info.userID = aaApi_GetCurrentUserId(); if (info.userID == -1) return false; if (aaApi_SelectUser(info.userID) == TRUE) info.mUsername = aaApi_GetUserStringProperty(USER_PROP_NAME, 0); } return aaApi_IsUserConnected(info.userID) == TRUE; }
the result is Connected = false, user id = 1, name = Administrator.
the input is all null/empty except hWndParent
Thank you
maybe aaApi_GetCurrentUserId() !=0 is enough