void client::EnableClientAffinity() { DWORD dwError = 0; //This code would eventually move out of here //when other APIs become remotable PVMAFD_SERVER pServer = NULL; dwError = VmAfdOpenServerA(NULL,NULL,NULL,&pServer); BAIL_ON_ERROR(dwError); dwError = CdcEnableClientAffinity(pServer); BAIL_ON_ERROR(dwError); cleanup: if (pServer) { VmAfdCloseServer(pServer); } return; error: THROW_IF_NEEDED(dwError); goto cleanup; }
JNIEXPORT jint JNICALL Java_com_vmware_identity_cdc_CdcAdapter_CdcEnableClientAffinity( JNIEnv *env, jobject clazz, jobject jpServer ) { DWORD dwError = 0; PVMAFD_SERVER pServer = NULL; if (jpServer == NULL) { dwError = ERROR_INVALID_PARAMETER; BAIL_ON_ERROR(dwError); } dwError = JniGetPointer(env, jpServer, (PVOID*)&pServer); BAIL_ON_ERROR(dwError); dwError = CdcEnableClientAffinity( pServer ); BAIL_ON_ERROR(dwError); cleanup: return dwError; error: goto cleanup; }