pk11_FreeSession(session);
CK_RV NSC_FindObjects(CK_SESSION_HANDLE hSession,    CK_OBJECT_HANDLE_PTR phObject,CK_ULONG ulMaxObjectCount,    					CK_ULONG_PTR pulObjectCount){    PK11Session *session;    PK11SearchResults *search;    int	transfer;    int left;    *pulObjectCount = 0;    session = pk11_SessionFromHandle(hSession);    if (session == NULL) return CKR_SESSION_HANDLE_INVALID;    if (session->search == NULL) {	pk11_FreeSession(session);	return CKR_OK;    }    search = session->search;    left = session->search->size - session->search->index;    transfer = ((int)ulMaxObjectCount > left) ? left : ulMaxObjectCount;    if (transfer > 0) {	PORT_Memcpy(phObject,&search->handles[search->index],                                        transfer*sizeof(CK_OBJECT_HANDLE_PTR));    } else {       *phObject = CK_INVALID_HANDLE;    }    search->index += transfer;    if (search->index == search->size) {	session->search = NULL;	pk11_FreeSearch(search);    }    *pulObjectCount = transfer;    return CKR_OK;}