Share via


CeSetSessionOption (EDB) (Windows CE 5.0)

Send Feedback

This function is used to set a per-session option. You can obtain a session for an open database by calling the CeGetDatabaseSession (EDB) function or you can create a new session by calling the CeCreateSession (EDB) function.

This function does not work with CEDB databases. For more information about CEDB, see CEDB Reference.

BOOL CeSetSessionOption(HANDLEhSession,ULONGulOptionId,DWORDdwValue);

Parameters

  • hSession
    [in] A handle to the session. This handle must have been returned from either the CeCreateSession or the CeGetDatabaseSession function.
  • ulOptionId
    [in] Specifies the option to set. ulOptionID can be either of the following options:
    • DBOPT_SESSION_MAX_CHANGES

      Used to control the maximum number of notification changes that are queued during a transaction. For more information about what this option affects, see Using Notifications with EDB. The dwValue parameter can be a value between 0 and 0xFFFFFFFF. If you specify 0, EDB generates only DB_NOTIFY_VOLUME_CHANGED notifications.

      Note   This setting overrides the MAX_NOTIFY_LIMIT setting that you set when mounting the volume. Once the session is complete, the MAX_NOTIFY_LIMIT setting will be in effect again.

    • DBOPT_SESSION_LOCK_TIMEOUT

      Used to control the maximum amount of time, in milliseconds, that a transaction should wait before a time-out occurs. A time-out may occur if an operation is waiting for a lock on a resource and that lock conflicts with a lock that has already been granted to a transaction in another session.

  • dwValue
    [in] The value of the option that is specified by ulOptionId.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table lists possible values returned by GetLastError:

Return Value Description
ERROR_INVALID_PARAMETER Indicates that ulOptionId is not a valid option, or that dwValue is not a valid option value for the option ID being set.
ERROR_INVALID_HANDLE Indicates that hSession is NULL or equal to INVALID_HANDLE_VALUE.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Windbase.h.
Link Library: Coredll.lib.

See Also

CeGetDatabaseSession (EDB) | CeCreateSession (EDB) | Using Notifications with EDB

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.