S
Steve C
Hi,
Im having a very annoying issue with the
DsRoleGetPrimaryDomainInformation function. That issue being I cant
get it to work
The error code returned is always "The parameter is
incorrect". For the life of me, nothing looks wrong but I'm sure its
staring me right in the face. Here is the snippit, ripped straight
from my code:
bool rc = false;
PBYTE * buf = NULL;
DWORD err;
err = DsRoleGetPrimaryDomainInformation (NULL,
DsRolePrimaryDomainInfoBasic,
buf);
if (err == ERROR_SUCCESS)
{
DSROLE_PRIMARY_DOMAIN_INFO_BASIC * info =
(DSROLE_PRIMARY_DOMAIN_INFO_BASIC *) buf;
// do stuff...
}
else
{
printf ("Could not retrieve DC Role info: %s", GET_AD_ERROR
(err));
}
Result is always: "Could not retrieve DC Role info: The parameter is
incorrect.
Its not exactly a complicated parameter list... I just cant see what I
have done wrong!! I'm trying to determine whether the host is a domain
controller or not, hence the reason why the first parameter is NULL. I
have even tried using netbios or dns host names for the first
parameter to see if that works - no joy either. Can anyone help?? Or
does anyone know of a better way to determine if the host is a domain
controller? (Right now I am looking at the MachineRole values inside
the structure returned..)
Regards,
Steve
Im having a very annoying issue with the
DsRoleGetPrimaryDomainInformation function. That issue being I cant
get it to work
![Smile :) :)](/styles/default/custom/smilies/smile.gif)
incorrect". For the life of me, nothing looks wrong but I'm sure its
staring me right in the face. Here is the snippit, ripped straight
from my code:
bool rc = false;
PBYTE * buf = NULL;
DWORD err;
err = DsRoleGetPrimaryDomainInformation (NULL,
DsRolePrimaryDomainInfoBasic,
buf);
if (err == ERROR_SUCCESS)
{
DSROLE_PRIMARY_DOMAIN_INFO_BASIC * info =
(DSROLE_PRIMARY_DOMAIN_INFO_BASIC *) buf;
// do stuff...
}
else
{
printf ("Could not retrieve DC Role info: %s", GET_AD_ERROR
(err));
}
Result is always: "Could not retrieve DC Role info: The parameter is
incorrect.
Its not exactly a complicated parameter list... I just cant see what I
have done wrong!! I'm trying to determine whether the host is a domain
controller or not, hence the reason why the first parameter is NULL. I
have even tried using netbios or dns host names for the first
parameter to see if that works - no joy either. Can anyone help?? Or
does anyone know of a better way to determine if the host is a domain
controller? (Right now I am looking at the MachineRole values inside
the structure returned..)
Regards,
Steve