Article ID: 129022
Article Last Modified on 7/24/2001
BOOL DlcSetMulticastAddress( BYTE bAdapter,
BYTE *pbResult, BYTE *pbAddress )
{
LLC_CCB Ccb;
Ccb.uchAdapterNumber = bAdapter;
Ccb.uchDlcCommand = LLC_DIR_SET_MULTICAST_ADDRESS;
// note: Dlc expects Ethernet addresses to be specified in the
// non-canonical form. In other words, reverse the bits
// before passing an Ethernet address.
//
// Also, the first byte of the canonical form of an
// Ethernet multicast address must be 0x01.
Ccb.u.pParameterTable = (PLLC_PARMS) pbAddress;
if(!DlcSyncCall( &Ccb ))
return FALSE;
else
{
*pbResult = Ccb.uchDlcStatus;
return TRUE;
}
}
// AcsLan wrapper function used by DlcSetMulticastAddress
BOOL DlcSyncCall( PLLC_CCB pCcb )
{
BOOL fResult = FALSE;
DWORD dwResult;
pCcb->hCompletionEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
if (!pCcb->hCompletionEvent)
return FALSE;
int iStatus = (int) AcsLan( pCcb, NULL );
if ( iStatus != ACSLAN_STATUS_COMMAND_ACCEPTED )
goto done;
dwResult = WaitForSingleObject( pCcb->hCompletionEvent, INFINITE );
if ( dwResult == WAIT_OBJECT_0 )
fResult = TRUE;
done:
CloseHandle( pCcb->hCompletionEvent );
return fResult;
}
Keywords: kbinfo kbapi kbnetwork kbcode KB129022