INFO: ????? ???????? ??? ??????? IDirectorySearch::GetNextRow

?????? ????????? ?????? ?????????
???? ???????: 325189 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

????? MSDN ??? ???? IDirectorySearch::GetNextRow ??? ????. ??? ???? ??????? S_ADS_NOMORE_ROWS ??? ????. ?? ???? ??? ????? "???? ?????? ?? ???? ?????? ? ???? ?? ???? ?????". ????? ?? ???? ????? ??? ?? "????? ???? ?????? ?? ???? ??????" ? ??? ??? ???? ?? ????? ??? ??? ??? ?? ????? ???? ?????? ???? ??????? ADsGetLastError. "

??????? ??? ????? ??????? ?????? ADSI ??? ??? ???? ?????????? ???? ?? ??????? ADsGetLastError. ?? ???? ?????? ??? ????? ??????? ??? ?????? ???? ?? ?? ????? ????? ??? ??? ?????? ??? ?????? ???? ??????. ?????? ??? ??????? ?????? ??? ???? ???? ???? ????? ??????? Microsoft Windows 2000 ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
260910????? ?????? ??? ???? ???? ???? ??????? Windows 2000

??????? ????

????? ???? ?????? IDirectorySearch::GetNextRow S_ADS_NOMORE_ROWS, ???? ?? ?? ???? ??????? ???? ???????? ?? ??????. ?? ??? ???????? ??? ????? S_ADS_NOMORE_ROWS ?????? ?????? GetNextRow ????? ??? ?????? ??? ???? ??? ?????? ??? ????? ?????? ??????? ????? ???? ?? ???? ???? ??????? ??????? ??????. ??? ????? ???? ?????? ????? "???? ??????? ??? ?? ??? LDAP. ?????? ??? ??????? ?????? ??? ???? LDAP ???? ??? ??? ??????? ????? ?????? ?? "????? ??????? ?? Microsoft:
315071HOW TO: ??? ?Set ???? LDAP ???????? Ntdsutil.exe
??? ????? ?????? ???? ?????? ????? ???? ??????? ? ???? ??? ??? ????? ?????? LDAP ?? ????????? ???? ????? ????? ????? ????? ????. ???? ?? ???? ????? ???? ?????? ????? ????? ?????? ??? ????? ?? ?????. ??? ???? ??? ?????? ?????? ??? ???? ????? ?????, ?? ???? ????? ???? ??????? ??? ?? ???? ?? ?????? ?? ??? ?????? ???? ????? ???? ?????? ?? ??????? ?? ??? ?????? ??? ????? ??? ???? ??????? ????? ??????.

????? ??? ????? S_ADS_NOMORE_ROWS ? ADSI ????? ????? ??? ??? ???? ?????????? ???? ?? ??????? ?????? ADsGetLastError. ??? ???? ADsGetLastError ERROR_MORE_DATA ? ???? ???? ?? ?????? ?? ??? ????? ????????? ???????? ??? ?? GetNextRow ??? ????.

The Platform SDK sample file, DsSrch, can be modified to handle this search method as shown in the following code sample:
"MAIN.CXX" file
//------------------------------------------------------------------
// 
//  Function:   Q325189_GetNextRow
// 
//  Synopsis:
// 
//------------------------------------------------------------------
HRESULT Q325189_GetNextRow(IDirectorySearch *pDSSearch, ADS_SEARCH_HANDLE hSearchHandle)
{
	HRESULT hr = S_OK;
	DWORD dwADsExtError = ERROR_SUCCESS;
	WCHAR szErrorBuf[512];
	WCHAR szNameBuf[128];

	do
	{
		// Clear ADSI extended error
		dwADsExtError = ERROR_SUCCESS;
		ADsSetLastError(ERROR_SUCCESS, NULL, NULL);

		// Next row
		hr = pDSSearch->GetNextRow(hSearchHandle);
		BAIL_ON_FAILURE(hr);

		// Check ADSI extend error if we got S_ADS_NOMORE_ROWS
		if (S_ADS_NOMORE_ROWS == hr)
		{
			hr = ADsGetLastError(&dwADsExtError, szErrorBuf, 512, szNameBuf, 128);
			BAIL_ON_FAILURE(hr);

			if (ERROR_MORE_DATA != dwADsExtError)
				// All data received
				return ERROR_NO_DATA;
		}

	} while (ERROR_MORE_DATA == dwADsExtError);

	return ERROR_MORE_DATA;

error:
	return hr;
}


//------------------------------------------------------------------
// 
//  Function:   main
// 
//  Synopsis:
// 
//------------------------------------------------------------------
INT _CRTAPI1
main(int argc, char * argv[])
{
...
	// *** MODIFIED FOR Q325189 *** 
	//hr = pDSSearch->GetNextRow(
	//         hSearchHandle
	//         );
	//BAIL_ON_FAILURE(hr);
	hr = Q325189_GetNextRow(pDSSearch, hSearchHandle); 
	// *** EOM ***

	// *** MODIFIED FOR Q325189 *** 
	//while (hr != S_ADS_NOMORE_ROWS && nRows < dwMaxRows) {<BR/>
         BAIL_ON_FAILURE(hr);
	while (nRows < dwMaxRows) {
	// *** EOM ***
        nRows++;

        if (dwNumberAttributes == -1) {
            hr = pDSSearch->GetNextColumnName(
                     hSearchHandle,
                     &pszColumnName
                     );
            BAIL_ON_FAILURE(hr);

            while (hr != S_ADS_NOMORE_COLUMNS) {
                hr = pDSSearch->GetColumn(
                         hSearchHandle,
                         pszColumnName,
                         &Column
                         );

                if (FAILED(hr)  && hr != E_ADS_COLUMN_NOT_SET)
                    goto error;

                if (SUCCEEDED(hr)) {
                    PrintColumn(&Column, pszColumnName);
                    pDSSearch->FreeColumn(&Column);
                }

                FreeADsMem(pszColumnName);
                hr = pDSSearch->GetNextColumnName(
                         hSearchHandle,
                         &pszColumnName
                         );
                BAIL_ON_FAILURE(hr);
            }
            printf("\n");
        }
        else {
            for (DWORD i=0; i<dwNumberAttributes; i++) {
                hr = pDSSearch->GetColumn(
                         hSearchHandle,
                         pszAttrNames[i],
                         &Column
                         );

                if (hr == E_ADS_COLUMN_NOT_SET)
                    continue;

                BAIL_ON_FAILURE(hr);

                PrintColumn(&Column, pszAttrNames[i]);

                pDSSearch->FreeColumn(&Column);
            }
        printf("\n");
        }

	// *** MODIFIED FOR Q325189 *** 
        //hr = pDSSearch->GetNextRow(
        //         hSearchHandle
        //         );
        //BAIL_ON_FAILURE(hr);
		hr = Q325189_GetNextRow(pDSSearch, hSearchHandle); 
	// *** END OF MODIFICATION ***
    }

    wprintf (L"Total Rows: %d\n", nRows);
...
}
				

?????

????? ?? ?????????? ?? ?????? ????? ??? MSDN ??????:

???????

???? ???????: 325189 - ????? ??? ??????: 21/?? ?????/1424 - ??????: 4.0
????? ???
  • Microsoft Active Directory Service Interfaces 2.5
  • Microsoft Active Directory Service Interfaces 2.5
????? ??????: 
kbmt kbdswadsi2003swept kbwin2ksp4fix kbinfo KB325189 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????325189
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com