ClearBox Server v1.2 Developer's Guide |
INASManagement::EnumUsersCalled by server to receive list of users currently connected to the NAS. Then this list is passed to ISynchronizer::Synchronize as usersList array. HRESULT EnumUsers( [out] unsigned long* usersNum, [out] USERADDRESS** usersInfo, [out] VARIANT_BOOL * statusOK); Parameters
Return ValuesIf extension returns error code, server will call this method after time span specified in "Synchronization fail retry interval" server configuration parameter. Thread SafetyThis method is called in context of SYNC thread. (See Server Threads Model for details.) You should synchronize data which is shared with other threads. Memory ManagementExtension may allocate memory for usersInfo calling CoTaskMemAlloc, and it is freed by server. RemarksSynchronizer must distinguish two different situations - when it fails to enumerate users due to its internal error and when it cannot connect to a NAS. In fommer case it rather should set statusOK to VARIANT_TRUE assuming that NAS is off or rebooting, and there are no current sessions on this NAS. This will allow server extension clear its table of active users' sessions. Example CodeThis code reports that there 3 users currently connected to NAS with which this synchronizer object is associated, and provides their names and NAS ports. STDMETHODIMP CSync::EnumUsers( unsigned long* usersNum, USERADDRESS** usersInfo, VARIANT_BOOL* statusOK) { *usersNum=3; *usersInfo=reinterpret_cast<USERADDRESS*>( CoTaskMemAlloc(sizeof(USERADDRESS)*3)); (*usersInfo)[0].userName=SysAllocString(L"John"); (*usersInfo)[0].port=SysAllocString(L"Async11"); (*usersInfo)[1].userName=SysAllocString(L"Ted"); (*usersInfo)[1].port=SysAllocString(L"Async13"); (*usersInfo)[2].userName=SysAllocString(L"Bill"); (*usersInfo)[2].port=SysAllocString(L"Async16"); *statusOK=VARIANT_TRUE; return S_OK; } See AlsoINASManagement, ISynchronizer::Synchronize, Synchronization process © 2001-2003 XPerience Technologies. www.xperiencetech.com |
Created by chm2web html help conversion utility. |