NOTIFYADD

The lpOperationInfo parameter of the notification function is a pointer to a NOTIFYADD structure which contains the add connection specific information as follows:

typedef struct _NOTIFYADD { 
  DWORD cbStructure;      
  HWND hwndOwner;
  NETRESOURCE NetResource;
  DWORD dwAddFlags;
  LPTSTR lpAccessName;         /* System name for connection */
      LPDWORD lpBufferSize;    /* Size of AccessName buffer */
  DWORD dwResult;              /* Information about connection */
  DWORD dwAddContext;          /* Context of add connection */
} NOTIFYADD, *LPNOTIFYADD;
 
cbStructure
The size of the NOTIFYADD structure in bytes.
hwndOwner
A handle to a window which should be the owner for any messages or dialog boxes the NP might display. This is only used if CONNECT_INTERACTIVE is set in dwAddFlags.
NetResource
Specifies the network resource to connect to. The following fields are valid:
lpRemoteName The name of the network resource. If this parameter is a pointer to an empty string, then access has been attempted to the entire network, such as when starting browsing to a network.
lpLocalName This specifies the name of a local device to be redirected, such as "F:" or "LPT1". The string is treated in a case-insensitive manner. lpLocalName may be a pointer to an empty string in which case, if lpRemoteName is pointer to a non-empty string, a connection to a network resource is being made without making a redirection.
lpProvider On pre-notification, specifies which NPs the connect operation was applied to. If a pointer to an empty string, then MPR has tried all valid providers. On post-notification, if the add operation was successful, specifies the name of the NP that performed the add operation.

dwType
Specifies the type of resource connected. It is RESOURCETYPE_DISK or RESOURCETYPE_PRINT if lpLocalName is a pointer to a non-empty string. It may also be RESOURCETYPE_ANY if lpLocalName is a pointer to an empty string and the connection attempt has failed.
dwAddFlags
A combination of the following values:
CONNECT_TEMPORARY The connection is being established for browsing purposes and will probably be released quickly.
CONNECT_INTERACTIVE May have interaction with the user.
CONNECT_PROMPT Do no use any defaults without offering user the chance to supply an alternative. This flag is only valid if CONNECT_INTERACTIVE is set.
CONNECT_UPDATE_PROFILE If the connection is being made persistent.
CONNECT_UPDATE_RECENT If the connection is being put in the recent connection list.
CONNECT_REDIRECT If set, force the auto-picking of a local device for redirection when making the connection, otherwise only auto-pick a local device for redirection if the network requires it to make a connection.

lpAccessName
Pointer to buffer to receive the name that can be used to make system requests on the connection.
lpBufferSize
The size of the lpAccessName buffer.
dwResult
Returned information about the connection.
dwAddContext
The context under which the add is being made, a combination of the following values:
CONNECT_CTXT_RESTORE The connection is being established to restore a persistent connection.
CONNECT_CTXT_GLOBAL All persistent connections are being restored. This flag is only valid if CONNECT_CTXT_ RESTORE is set.
CONNECT_CTXT_PROVIDER The persistent connections for a specific network alone are being restored. This flag is only valid if CONNECT_CTXT_ RESTORE is set.
CONNECT_CTXT_SINGLE An individual persistent connection is being restored. This flag is only valid if CONNECT_CTXT_ RESTORE is set.