How do I find what a microsoft defined constant actually equates to?

Started by dicky96, January 14, 2006, 07:14:49 PM

Previous topic - Next topic

dicky96

I'm not sure if I phrased the title of this thread properly.....

What I mean is, say in microsoft documentation it says something like MSG_WAITALL  how do I look up what that value equates to?  If it is not already defined in MASM headers.

I can't seem to find that information in the MSDN pages.

In the case above this contant is used by winsock recv function which microsoft say needs winsock2.h so I kinda expected to find the value defined there but it is not.

Is there some big list somwhere that I can just look these values up, save wasting a lot of time trying to find them?

dicky

GregL

dicky96,

You are on the right track, you just missed it. Look in winsock2.h again, it is there. I use a "find in files" search utility to search the C header (.h) files in the Platform SDK include directory.




dicky96

U sure m8?

I just opened winsock2.h (from C:\Program Files\Microsoft Visual Studio\VC98\Include) using Ultraedit, did a search for WAITALL and found 2 instances, neither of which define the constant

I know that is an old version of VC but I don't program in C so it is what I have

msmith

Looking at winsock2.h, WAITALL is a boolean member of two different structures. It is not a constant. This is why you cannot fiind the value of a constant.

zooba

Try searching the entire directory for the text.

If you don't have a program to do it try this:

FOR %F IN (*.h) DO @TYPE %F | FIND "your keyword here"

A simple "FIND ... *.h" will work, but it displays the name of each file it searches so your result will quickly run off the screen. :U

Edit: BTW, I didn't find MSG_WAITALL in the 2003 PSDK headers :(

GregL

I guess it's new.

Windows Server 2003 SP1 Platform SDK

Searching for: MSG_WAITALL
WinSock2.h(658): #define MSG_WAITALL     0x8             /* do not complete until packet is completely filled */
Found 1 occurrence(s) in 1 file(s)


That is C:\Program Files\Microsoft Platform SDK\Include\WinSock2.h



dicky96

Thanks for the clarification.  It doesn't work anyway. When I set this flag I get SOCKET_ERROR. 

I'm guessing if this flag is new in a later winsock2.h than the one i have, then I need a later ws2_32.lib as well?

Not to worry I've examined other's code and made a recv loop now that reads the data from the socket until the host disconnects. Which leads me to my next question.....  but that is a whole new thread  :lol

Ratch