int open_session_main( int argc, char *argv[] ) { DWORD dwError = 0; HANDLE hLsaConnection = NULL; PTESTDATA pTestData = NULL; dwError = Lwt_LsaTestSetup( argc, argv, &hLsaConnection, &pTestData); if ( dwError ) goto error; dwError = Lwt_LsaOpenSession(hLsaConnection, pTestData); if ( dwError ) goto error; cleanup: Lwt_LsaTestTeardown(&hLsaConnection, &pTestData); return LwtMapErrorToProgramStatus(dwError); error: goto cleanup; }
int find_user_by_name_main( int argc, char *argv[] ) { DWORD dwError = LW_ERROR_SUCCESS; HANDLE hLsaConnection = NULL; PTESTDATA pTestData = NULL; dwError = Lwt_LsaTestSetup( argc, argv, &hLsaConnection, &pTestData); if ( dwError ) { goto error; } dwError = Lwt_LsaFindUserByName( hLsaConnection, pTestData); BAIL_ON_TEST_BROKE(dwError); cleanup: Lwt_LsaTestTeardown( &hLsaConnection, &pTestData); return LwtMapErrorToProgramStatus(dwError); error: goto cleanup; }
int test_local_provider_main( int argc, char *argv[] ) { DWORD dwError = LW_ERROR_SUCCESS; HANDLE hLsaConnection = NULL; PTESTDATA pTestData = NULL; dwError = Lwt_LsaTestSetup(argc, argv, &hLsaConnection, &pTestData); if ( dwError ) goto error; dwError = Lwt_LsaTestLocalProvider(hLsaConnection); if ( dwError ) goto error; cleanup: Lwt_LsaTestTeardown(&hLsaConnection, &pTestData); return LwtMapErrorToProgramStatus(dwError); error: goto cleanup; }
int enum_users_main( int argc, char *argv[] ) { DWORD dwError = 0; HANDLE hLsaConnection = NULL; PTESTDATA pTestData = NULL; dwError = Lwt_LsaTestSetup( argc, argv, &hLsaConnection, &pTestData); if ( dwError ) goto error; dwError = Lwt_LsaEnumUsers(hLsaConnection, pTestData); if ( dwError ) goto error; dwError = ValidateEnumUsersForInvalidData( hLsaConnection, pTestData); if (dwError) goto error; cleanup: Lwt_LsaTestTeardown(&hLsaConnection, &pTestData); return LwtMapErrorToProgramStatus(dwError); error: goto cleanup; }
int get_metrics_main( int argc, char *argv[] ) { HANDLE hLSAConnection = NULL; PLSA_METRIC_PACK_0 pMetrics_0 = NULL; PLSA_METRIC_PACK_1 pMetrics_1 = NULL; PTESTDATA pTestData = NULL; DWORD dwError = LW_ERROR_SUCCESS; dwError = Lwt_LsaTestSetup(argc, argv, &hLSAConnection, &pTestData); BAIL(dwError); /*Start collect the groups for the level 1*/ dwError = LsaGetMetrics(hLSAConnection, 0, (PVOID *) &pMetrics_0); BAIL(dwError); if (pMetrics_0) { Lwt_LsaPrintMetrics((PVOID) pMetrics_0, 0); } dwError = LsaGetMetrics(hLSAConnection, 1, (PVOID *)&pMetrics_1); BAIL(dwError); if (pMetrics_1) { Lwt_LsaPrintMetrics((PVOID) pMetrics_1, 1); } cleanup: if (pMetrics_0 != NULL) { LwFreeMemory(pMetrics_0); pMetrics_0 = NULL; } if (pMetrics_1 != NULL) { LwFreeMemory(pMetrics_1); pMetrics_1 = NULL; } Lwt_LsaTestTeardown(&hLSAConnection, &pTestData); return dwError; error: goto cleanup; }