Share via


IDelaydC::Connect

The Connect method connects the NPP to the network by using a specified network interface card and provides configuration information about the connection.

HRESULT STDMETHODCALLTYPE Connect(HBLOBhInputBlob,
LPVOIDStatusCallbackProc,
LPVOIDUserContext,
HBLOBhErrorBlob);

Parameters

  • hInputBlob
    [in] Handle to the BLOB that specifies the NIC that you are connecting to and the configuration information about that connection.
  • StatusCallbackProc
    [in] Address of the user's callback function, which is used to receive status updates such as triggers. If no callback function is used, set this parameter and the UserContext parameter to NULL.
  • UserContext
    [in] Value passed when the user's callback function is called. The value of this parameter is typically either HWND or a 'this' pointer. If a callback function is not specified, set this parameter and the StatusCallbackProc parameter to NULL.
  • hErrorBlob
    [out] Handle to an error BLOB that contains additional error information.

Return Values

If this method is successful, the return value is NMERR_SUCCESS.

If the method is unsuccessful, the return value is one of the following error codes (which include those errors returned by the internal IDelaydC::Configure call):

Return code Description
NMERR_ALREADY_CONNECTED This instance of the NPP COM object is already connected to the network.
NMERR_BLOB_CONVERSION_ERROR The configuration BLOB is corrupt. This error is generated by the IDelaydC::Configure call.
NMERR_BLOB_ENTRY_DOES_NOT_EXIST The input BLOB specified by hInputBlob is missing an entry needed to perform this operation. This error may be generated by the IDelaydC::Connect or IDelaydC::Configure call. Look at the error BLOB returned by hErrorBlob to determine which entry was not found.
NMERR_BLOB_NOT_INITIALIZED The CreateBlob function has not been called. This error is generated by the IDelaydC::Configure call.
NMERR_BLOB_STRING_INVALID The string is not null-terminated. This error is generated by the IDelaydC::Configure call.
NMERR_ILLEGAL_TRIGGER The trigger portion of the input BLOB is corrupt. This error is generated by the IDelaydC::Configure call.
NMERR_INVALID_BLOB The object specified in hInputBlob is not a BLOB. This error is generated by the IDelaydC::Configure call.
NMERR_NO_DEFAULT_CAPTURE_DIRECTORY The default capture directory was not set in the registry. Use the following path to set the capture directory.
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\nm\Parameters\CapturePath
NMERR_OUT_OF_MEMORY No memory was available to perform this operation. This error is generated by the IDelaydC::Configure call.
NMERR_TIMEOUT The request has timed out. This error is generated by the IDelaydC::Configure call.
NMERR_UPLEVEL_BLOB The version number of the BLOB specified in hInputBlob is incorrect. This error is generated by the IDelaydC::Configure call.

Remarks

When the Connect method is called, the NPP automatically calls IDelaydC::Configure by using the BLOB provided by hInputBlob. Note that any error codes returned by the call to IDelaydC::Configure are passed back and returned by the IDelaydC::Connect call.

This method must be called before you can start capturing frames. Note that when you connect to the network by using this method, you must continue to use the IDelaydC interface methods to capture frames.

The input BLOB specified by the hInputBlob parameter can be obtained by calling GetNPPBlobFromUI, GetNPPBlobTable, and SelectNPPBlobFromTable.

The error BLOB returned in hErrorBlob contains error information that the developer or the application can use for troubleshooting. The error BLOB returned by hErrorBlob contains entries that Network Monitor could not understand or find in the input BLOB specified in hInputBlob. For example, if NMERR_BLOB_ENTRY_DOES_NOT_EXIST is returned, the entry Network Monitor could not find is included in the returned error BLOB.

For information about See
Obtaining the input BLOB that represents a NIC Selecting a Network Interface Card

Requirements

Client Requires Windows XP, Windows 2000 Professional, or Windows NT Workstation 4.0.
Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.
Header

Declared in Netmon.h.

DLL Requires Ndisnpp.dll. Requires Rmtnpp.dll.

See Also

IDelaydC::Configure, IDelaydC::Disconnect, IDelaydC::Start