ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am working on a project to convert several windows programs into linux, but I am having a hard time finding the definitions of many windows datatypes (go figure ;-)... I was hoping that someone knew what kind of datatypes DWORD, WORD, OVERLAPPED, HANDLE, and NEAR are. Also- do you have any suggestions about how to convert them? Is there a way to install windows.h onto linux?
DWORD = long (a 32 bit value)
WORD = int (16 bit value)
HANDLE = void *
I do not know what OVERLAPPED is. However, I've encountered NEAR keyword (I should say declaration, since Microsoft absolutely finds it necessary to declare macros for everything), and NEAR's complement, FAR. These are actually 'near' and 'far' in the C language, and aren't used often anymore (except maybe some low level stuff).
From what I remember, these keywords were used some time ago on 16 bit Intel machines. Using the 'near' keyword, would force the storage pointer to require 16 bits, whereas far would require 32 bits. far, though, would be composed of 2 near pointers, one padded with 4 bits. Effectively this would give you only 28 bits of space...
OVERLAPPED, however, never seen that. Sorry.
Hope that helps.
By the way, if you want more definitions, I suggest you check out windefs.h.
DWORD = long (a 32 bit value)
WORD = int (16 bit value)
This is a little misleading because int and long aren't guaranteed to be 16 and 32 bits. In particular, they are both 32 bits on x86 (maybe only a more modern subcategory of x86?), If you want a 32 bit value, you should use int32_t (and likewise int16_t) in <stdint.h>.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.