Help - Search - Members - Calendar
Full Version: metadb::handle_create, win32_event
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
musicmusic
Just some things I was wondering about..

QUOTE
//! Returns metadb_handle object referencing specified location (attempts to find existing one, creates new one if doesn't exist).
//! @param p_out Receives metadb_handle pointer.
//! @param p_location Location to create metadb_handle for.
//! @returns true on success, false on failure (rare).
virtual void handle_create(metadb_handle_ptr & p_out,const playable_location & p_location)=0;

So there is no chance of failure now?

CODE
    //! Returns true when signaled, false on timeout
    static bool g_wait_for(HANDLE p_event,double p_timeout_seconds) {
        SetLastError(NO_ERROR);
        DWORD status = WaitForSingleObject(p_event,g_calculate_wait_time(p_timeout_seconds));
        switch(status) {
        case WAIT_FAILED:
            throw exception_win32(GetLastError());
        default:
            throw pfc::exception_bug_check();
        case WAIT_OBJECT_0:
            return false;
        case WAIT_TIMEOUT:
            return true;
        }
    }
The documentation here didn't look too right to me either ?
Peter
The latter is fixed in current SDK.
foosion
QUOTE(musicmusic @ Jun 3 2006, 21:22) *
So there is no chance of failure now?
I think it will now throw an exception on failure.
musicmusic
QUOTE(Peter @ Jun 3 2006, 19:23) *

The latter is fixed in current SDK.

Thanks, redownloaded now.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.