Data type HANDLE
-
Hello , As I know from Inside Win2k, when a process creates or opens an object(object is almost everything in Windows ) by name, it receives a handle that represents its access to the object. This is like a secure pointer taken from OS. **Object is symbolic link, process, thread, job, section, event, semaphore and ...
-
Hello , As I know from Inside Win2k, when a process creates or opens an object(object is almost everything in Windows ) by name, it receives a handle that represents its access to the object. This is like a secure pointer taken from OS. **Object is symbolic link, process, thread, job, section, event, semaphore and ...
I spoke wrong. I mean literally what is it in terms of size. For example, DWORD is really a 32-bit unsigned integer. I'm trying to read some data that contains HANDLE type in a structure. I'm reading it over in a UNIX app. I have no use for the HANDLE, but my sizing will be wrong if I ignore it.
-
I spoke wrong. I mean literally what is it in terms of size. For example, DWORD is really a 32-bit unsigned integer. I'm trying to read some data that contains HANDLE type in a structure. I'm reading it over in a UNIX app. I have no use for the HANDLE, but my sizing will be wrong if I ignore it.
me think a HANDLE is the same size as a pointer; so 32 bits. look into winnt.h
Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
-
I spoke wrong. I mean literally what is it in terms of size. For example, DWORD is really a 32-bit unsigned integer. I'm trying to read some data that contains HANDLE type in a structure. I'm reading it over in a UNIX app. I have no use for the HANDLE, but my sizing will be wrong if I ignore it.
How about sizeof(HANDLE) ?
-
HANDLE is unsigned long (DWORD). It is like a pointer because it is unique, but it is hashed to some pointed in memory. Windows manages the memory and this can be shifted and moved around to prevent memory fragmentation, but the HANDLE remains the same. J. ----------------------------
-
I spoke wrong. I mean literally what is it in terms of size. For example, DWORD is really a 32-bit unsigned integer. I'm trying to read some data that contains HANDLE type in a structure. I'm reading it over in a UNIX app. I have no use for the HANDLE, but my sizing will be wrong if I ignore it.
I think this will give you clear answer ! typedef void *PVOID; .... #ifdef STRICT typedef void *HANDLE; #define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name #else typedef PVOID HANDLE; #define DECLARE_HANDLE(name) typedef HANDLE name #endif typedef HANDLE *PHANDLE; ** This is taken from WinNT.h