The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: dicky96 on January 14, 2006, 07:14:49 PM

Title: How do I find what a microsoft defined constant actually equates to?
Post by: dicky96 on January 14, 2006, 07:14:49 PM
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
Title: Re: How do I find what a microsoft defined constant actually equates to?
Post by: GregL on January 14, 2006, 07:47:55 PM
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.



Title: Re: How do I find what a microsoft defined constant actually equates to?
Post by: dicky96 on January 14, 2006, 07:58:09 PM
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
Title: Re: How do I find what a microsoft defined constant actually equates to?
Post by: msmith on January 14, 2006, 08:30:45 PM
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.
Title: Re: How do I find what a microsoft defined constant actually equates to?
Post by: zooba on January 14, 2006, 10:24:22 PM
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 :(
Title: Re: How do I find what a microsoft defined constant actually equates to?
Post by: GregL on January 15, 2006, 12:11:39 AM
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


Title: Re: How do I find what a microsoft defined constant actually equates to?
Post by: dicky96 on January 15, 2006, 05:54:59 PM
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
Title: Re: How do I find what a microsoft defined constant actually equates to?
Post by: Ratch on January 22, 2006, 03:18:50 PM
dicky96,
     Doing a simple Google search on MSG_WAITALL finds the value to be 0100H.  Ratch

http://www.freepascal.org/docs-html/rtl/sockets/msg_waitall.html