Find OVERLAPPED structure given only a HANDLE? - Programmer

This is a discussion on Find OVERLAPPED structure given only a HANDLE? - Programmer ; Hi, just a quick question before I go get drunk (it *is* Friday)... ....Is it possible, given only a HANDLE to a file or socket (or whatever), to obtain the OVERLAPPED structure that was previously associated with that handle without ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Find OVERLAPPED structure given only a HANDLE?

  1. Find OVERLAPPED structure given only a HANDLE?

    Hi, just a quick question before I go get drunk (it *is* Friday)...

    ....Is it possible, given only a HANDLE to a file or socket (or
    whatever), to obtain the OVERLAPPED structure that was
    previously associated with that handle without having to
    maintain a list of the HANDLEs and their OVERLAPPED
    structures?

    Thanks y'all.



  2. Re: Find OVERLAPPED structure given only a HANDLE?

    In message , Damian Kelfer
    writes
    >Hi, just a quick question before I go get drunk (it *is* Friday)...
    >
    >...Is it possible, given only a HANDLE to a file or socket (or
    >whatever), to obtain the OVERLAPPED structure that was
    >previously associated with that handle without having to
    >maintain a list of the HANDLEs and their OVERLAPPED
    >structures?


    Not that I'm aware of. The overlapped structure (certainly in some
    cases) is allocated from (this is from memory, forgive if I get the
    allocator wrong) GlobalAlloc or CoTaskMemAlloc - definitely a memory
    allocator. As such its a user mode allocation and not related to a
    handle (in terms of kernel object mapping). There a few vague (and they
    are vague) references to this in disparate parts of MSDN, not gathered
    in one place.

    I only know this as I had to do some research into possible memory leaks
    related to overlapped structures about a year ago, I seem to remember I
    found one function in the Win32 API that was a candidate, and I can't
    remember its name right now.

    Of course, now I've written this, some bright soul will popup and say
    its XYZ() api call.

    Stephen
    --
    Stephen Kellett
    Object Media Limited http://www.objmedia.demon.co.uk
    RSI Information: http://www.objmedia.demon.co.uk/rsi.html

+ Reply to Thread