How does it work?

MagNumDB is a database that contains about 350,000 items. These items are constants, names, values all extracted from more than 4,200 header files (.h, .hxx, .hpp, .idl, etc.) provided by standard Windows and Visual Studio SDKs.
Some values have been extracted from the very special uuid.lib file that contains the value of thousands of guids and property keys, not present anywhere else in header files.

 "C2P5"

To build this database, we have written a powerful C/C++ parser named C2P5 (for C/CPP/PreProcessor/Parser), tailored specifically for this task. C2P5 is capable of preprocessing, parsing and partially evaluating all header files as if they were included in a one big virtual project (that of course, does not compile). It currently supports the following preprocessor and C/C++ constructs:

  • #define preprocessor that define constants
  • #define preprocessor that define expression to compute constants
  • C and C++ enum definitions
  • Special GUID constructs like DECLSPEC_UUID, DEFINE_GUIDSTRUCT or MIDL_INTERFACE
  • Some IDL constructs
  • Etc.

The parser remembers dynamic preprocessor definitions (#if, #ifdef, etc.) that are conditions for constants definitions and expression computation. All parsed items are saved in the database, as well as the associated conditions. There may be more than one item corresponding to a given name, if there are differences in their associated conditions.

C2P5 supports the following types of constants, regardless of the way they are defined in source files:

  • integer, signed or unsigned, from 8-bit to 128-bit
  • floating point number, single (32-bit) or double (64-bit)
  • globally unique identifier, or guid, uuid, CLSID, IID, etc.
  • string, in narrow, wide, or utf-8/16/32 formats
  • character, in narrow, wide, or utf-8/16/32 formats
  • pointer, a constant cast as a pointer
  • property key, or PKEY, a combination of a guid (fmtid) and a 32-bit integer (id).

 Powered by

C2P5 and this MagNumDB web site are written in C# and use a Lucene database as a full-text search engine. C2P5 uses a custom ANTLR4cs C grammar for expression parsing, not for preprocessor parsing.

 

 Frequently Asked Questions

  • Q: Can I run custom queries?
    A: Yes. You can use Lucene's query syntax. Note the Database is case insensitive. Check out the list of columns with their corresponding database column names:

    • Index: the item's index.
    • Name: the item's name, or title. For enum values, it's prefixed with the enum's name.
      Corresponding database field: title.
    • Type: the item's type, expressed in a specific, universal system.
      Corresponding Lucene's field: valuetype, but use the value of the Storage type column for queries on items type.
    • Value: the item's value. For string values, it's displayed as is w/o quotes nor escaping.
      Corresponding database field: value. There is also a typedvalue field that can contain Lucene's Int32, Int64, Float, Double or String typed values.
    • Hex Value: the item's hexadecimal value, only valid for integer types.
      There is no corresponding database field.
    • Signed Value: the item's signed value, only valid for integer and double types. Useful when you found a unsigned number and want to get the corresponding signed value (uint -> int for example).
      There is no corresponding database field.
    • Source lines(s): the source lines from which the item was extracted. Comments and characters such as TAB, CR are preserved.
      Corresponding database field: source.
    • File path: the file path from which the item was extracted, terminated by the line index.
      Corresponding database field: filepath. There are also directory and filename fields. filename is useful to query for values in a given file.
    • Score: Lucene's score value. Items are returned sorted by score.
    • Guid formats: a utility columns that proposes all possible guid formats. Only valid for guid types.
      There is no corresponding database field
    • Char type: the character encoding (narrow, wide, etc.). Only valid for char and string values.
      Corresponding database field: chartype.
    • Storage type: the exact storage type in the database. Only used for specific queries.
      Corresponding database field: valuetype.
    • Conditions: the list of preprocessor conditions for a given item. If a condition is surrounded with a REVERSE function, it means the reverse condition of what's surrounded was the condition.
      Corresponding database field: conditions. There may be multiple conditions fields for one item.

    Some important points to note:

    • If you search for a negative number (like error codes expressed using signed integers), you can surround the search with double quotes, for example searching for "-2147009290" is equivalent to searching for 0x80073CF6, 80073CF6 (or even 3CF6 in this specific case). If you don't surround negative numbers with double quotes, the system will search for signed and unsigned corresponding values.
    • The full-text search uses items' name, value, hex value, guid formats, source lines, etc. so refine your search if you get back too many items.
    • You can search for guid binary values using just a part of their full definition. For example, if you search for '79eac9c5', it will get you 3 guid entries
    • Leading wild card search (*whatever) is allowed, but it may slow down the search significantly.

    Here are some example or custom queries:

    title:wm_user returns the WM_USER Windows message item, not all items that reference the WM_USER token.

    title:wm_u* returns all items (Windows messages probably) whose name starts with WM_U*.

    value:1024 AND title:wm_* returns all items (Windows messages probably) whose name starts with WM_U* and value is 1024. Note AND must be UPPERCASE for Lucene's to understand it as an AND operator.

    value:"00000002-0000-0000-C000-000000000046" returns the IMalloc IID guid value.

  • Q: I always get back 400 items at most. Why?
    A: The MagNumDb site currently limits the number of returned items to this value by design. This should be enough for most real search scenarios (like enums with a big list of values).

  • Q: Some values are empty. Why?
    A: The expression evaluator cannot always compute the final value, because it sometimes require contextual information (custom defines, compiler architecture, etc.) that the parser doesn't have. You can enable the Source line(s) column to check what's the corresponding source and try to work it out by yourself. The origin file path and line number is also included.

  • Q: Can I get all values for a given enum?
    A: Sure. For example, __VSHPROPID is the name of an enum, and a query like this: parent:__VSHPROPID will get all the enum's values (66 entries).

  • Q: I sometimes get back items whose name starts with "__magnumdb__enum_". Why?
    A: C allows unnamed enums. The MagNumDb parser just gives them a name, using the defining file name and a counter.

  • Q: I sometimes get back the same item/name twice or more with different values. For example:  TARGET_IS_NT60_OR_LATER. Why?
    A: This can be the case with defines. Their value may be different if they were surrounded by # directives (#if, #else, etc.) in the original source code. You can enable the Condition(s) column to check what are the corresponding conditions for a given item.
    Note: if a condition is surrounded with a funny REVERSE function token, it means the reverse condition of what's surrounded.

 Database Metrics

  • Last update date: Wednesday, October 3, 2018
  • Items count: 335808
  • Parsed files count: 5759
  • Windows SDK version: 10.0.17763.0

 

 Contact

We welcome feedback.
Seen anything missing? A bug? A wrong value? Do you have any suggestion for improvements? Do you have an idea for a cool new feature?

Please contact us here

 About MagNumDB

MagNumDB  2017-2018 Simon Mourier V1.2.0. All rights reserved.

Profile for Simon Mourier at Stack Overflow, Q&A for professional and enthusiast programmers


All product names, logos, and brands are property of their respective owners. All company, product and service names used in this website are for identification purposes only.

All values, names, source code fragments displayed here have been extracted from files that are property of their respective owners.

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND OTHER THAN AS SPECIFICALLY SET FORTH IN THE LICENSE AGREEMENT, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index Score Name Type Value Hex value Signed value Guid formats Char type Storage type Source line(s) File path Condition(s)
Index Score Name Type Value Hex value Signed value Guid formats Char type Storage type Source line(s) File path Condition(s)
1 0.404951 __magnumdb__enum_msotcdar_h_1 Enum
enum {
	msofidNil = -1,
	msoqfidNil = -1,
	msofidMsoDll           = 0x00000,	// (0) mso$d.dll
	msofidRiched20Dll      = 0x00001,	// (1) riched20.dll
	msofidUser32Dll        = 0x00002,	// (2) USER32.dll
	msofidGdi32Dll         = 0x00003,	// (3) GDI32.dll
	msofidWinnlsDll        = 0x00004,	// (4) WINNLS.dll
	msofidShell32Dll       = 0x00005,	// (5) SHELL32.dll
	msofidComctl32Dll      = 0x00006,	// (6) COMCTL32.dll
	msofidOleaut32Dll      = 0x00007,	// (7) OLEAUT32.dll
	msofidComDlg32Dll      = 0x00008,	// (8) COMDLG32.dll
	msofidKernel32Dll      = 0x00009,	// (9) KERNEL32.dll
	msofidVersionDll       = 0x0000a,	// (10) VERSION.dll
	msofidWinmmDll         = 0x0000b,	// (11) WINMM.dll
	msofidMapi32Dll        = 0x0000c,	// (12) MAPI32.dll
	msofidHlinkDll         = 0x0000d,	// (13) HLINK.dll
	msofidUrlmonDll        = 0x0000e,	// (14) URLMON.dll
	msofidOleAccDll        = 0x0000f,	// (15) OLEACC.dll
	msofidWsock32Dll       = 0x00010,	// (16) WSOCK32.dll
	msofidMprDll           = 0x00011,	// (17) MPR.dll
	msofidOdma32Dll        = 0x00012,	// (18) ODMA32.dll
	msofidWininetDll       = 0x00013,	// (19) wininet.dll
	msofidRpcrt4Dll        = 0x00014,	// (20) RPCRT4.dll
	msofidImm32Dll         = 0x00015,	// (21) imm32.dll
	msofidShlwapiDll       = 0x00016,	// (22) shlwapi.dll
	msofidMscat32Dll       = 0x00017,	// (23) mscat32.dll
	msofidUcscribeDll      = 0x00018,	// (24) UCSCRIBE.DLL
	msofidImeShareDll      = 0x00019,	// (25) MSOSTYLE.dll
	msofidAWJIMECLPath     = 0x0001a,	// (26) imejpcl.aw
	msofidAWJIMESMPath     = 0x0001b,	// (27) imejpsm.aw
	msofidUDateDll         = 0x0001c,	// (28) IntlDate.DLL
	msofidUspDll           = 0x0001d,	// (29) usp10.dll
	msofidBidi32Dll        = 0x0001e,	// (30) BIDI32.DLL
	msofidSelfRegDll       = 0x0001f,	// (31) SelfReg$D.dll
	msofidT2EmbedDll       = 0x00020,	// (32) T2EMBED.DLL
	msofidOdbc32Dll        = 0x00021,	// (33) ODBC32.DLL
	msofidOdbccp32Dll      = 0x00022,	// (34) ODBCCP32.dll
	msofidMLangDll         = 0x00023,	// (35) mlang.dll
	msofidWinspoolDll      = 0x00024,	// (36) winspool.drv
	msofidUnlockDll        = 0x00025,	// (37) unlock.dll
	msofidFtpSiteExe       = 0x00026,	// (38) mso7ftp.exe
	msofidAddSiteExe       = 0x00027,	// (39) mso7ftpa.exe
	msofidFtpSitesExe      = 0x00028,	// (40) mso7ftps.exe
	msofidmsoDll           = 0x00029,	// (41) mso$d#h.dll
	msofidMsJet40Dll       = 0x0002a,	// (42) MSJET40.dll
	msoqfidMsoIntlDll      = 0x0002b,	// (43) msointl$d#h.dll
	msoqfidMsoACL          = 0x0002c,	// (44) mso.acl
	msofidavifil32Dll      = 0x0002d,	// (45) avifil32.dll
	msofidmsvfw32Dll       = 0x0002e,	// (46) msvfw32.dll
	msofidMsacm32Dll       = 0x0002f,	// (47) msacm32.dll
	msofidIppWFFDll        = 0x00030,	// (48) ippwff.dll
	msofidNetApi32Dll      = 0x00031,	// (49) netapi32.dll
	msofidVbeDll           = 0x00032,	// (50) vbe6.dll
	msoqfidMsoHelp         = 0x00033,	// (51) msohelp$d.exe
	msoqfidOfficeTipHelp   = 0x00034,	// (52) oftip10.hlp
	msoqfidOfficePssHelp   = 0x00035,	// (53) pss10r.chm
	msoqfidOfficePssOEMHelp = 0x00036,	// (54) pss10o.chm
	msoqfidOfficeMainHelp  = 0x00037,	// (55) ofmain10.chm
	msoqfidDaoHelp         = 0x00038,	// (56) dao360.chm
	msoqfidVbaHelp         = 0x00039,	// (57) vblr6.chm
	msoqfidAWFeedback      = 0x0003a,	// (58) Feedback.htm
	msoqfidAWThankYou      = 0x0003b,	// (59) ThankYou.htm
	msofidNLGSpellGlue     = 0x0003c,	// (60) csapi3t1.dll
	msofidNLGThesaurusGlue = 0x0003d,	// (61) ctapi3t2.dll
	msofidNLGHyphenatorGlue = 0x0003e,	// (62) chapi3t1.dll
	msoqfidMSRouteDLL      = 0x0003f,	// (63) MSROUTE.DLL
	msofidHlinkPrxDll      = 0x00040,	// (64) hlinkprx.dll
	msofidOsbExe           = 0x00041,	// (65) msoffice.exe|msofficd.exe
	msofidOsbIntlDll       = 0x00042,	// (66) osbintl$d.dll
	msofidMSQuery          = 0x00043,	// (67) msqry32.exe
	msoqfidOrgChartCnv     = 0x00044,	// (68) orgcnv.dll
	msoqfidDrawCnv         = 0x00045,	// (69) drawcnv.dll
	msofidPubPrtf9         = 0x00046,	// (70) prtf9$d.dll
	msofidPubPtxt9         = 0x00047,	// (71) ptxt9$d.dll
	msofidMsInfoExe        = 0x00048,	// (72) msinfo32.exe
	msofidAccessExe        = 0x00049,	// (73) msaccess.exe
	msofidExcelExe         = 0x0004a,	// (74) excel.exe
	msofidWordExe          = 0x0004b,	// (75) winword$d#h.exe
	msofidPowerPointExe    = 0x0004c,	// (76) powerpnt.exe
	msofidOutlookExe       = 0x0004d,	// (77) outlook.exe
	msofidBinderExe        = 0x0004e,	// (78) binder$d#h.exe
	msofidWord9Exe         = 0x0004f,	// (79) winword.exe
	msofidFrontPageExe     = 0x00050,	// (80) frontpg.exe
	msofidPublisherExe     = 0x00051,	// (81) mspub.exe
	msofidProjectExe       = 0x00052,	// (82) winproj.exe
	msofidFoxProExe        = 0x00053,	// (83) vfp.exe
	msofidOsaExe           = 0x00054,	// (84) osa$d.exe
	msofidPhotoDrawExe     = 0x00055,	// (85) photodrw.exe
	msofidDesignerExe      = 0x00056,	// (86) designer.exe
	msofidVisioExe         = 0x00057,	// (87) visio.exe
	msofidThemesFontMap    = 0x00058,	// (88) themes.inf
	msofidMsLid            = 0x00059,	// (89) mslid.dll
	msofidCrypt32Dll       = 0x0005a,	// (90) crypt32.dll
	msofidWintrustDll      = 0x0005b,	// (91) wintrust.dll
	msofidCryptdlgDll      = 0x0005c,	// (92) cryptdlg.dll
	msofidSignerDll        = 0x0005d,	// (93) signer.dll
	msofidSoftpubDll       = 0x0005e,	// (94) softpub.dll
	msofidAdvapi32Dll      = 0x0005f,	// (95) advapi32.dll
	msofidTypeLibStd2      = 0x00060,	// (96) stdole2.tlb
	msofidTypeLibVba       = 0x00061,	// (97) vbaen32.olb
	msofidMsowcDll         = 0x00062,	// (98) owc10$d.dll
	msofidAnswerWizard     = 0x00063,	// (99) aw$d.dll
	msofidFindFastExe      = 0x00064,	// (100) findfast.exe|ffastd.exe
	msofidMSE10            = 0x00065,	// (101) mse7.exe
	msofidWWordBreakerJ    = 0x00066,	// (102) msgr3jp.dll
	msofidSCWrdBkrDll      = 0x00067,	// (103) msgr3sc.dll
	msofidTCWrdBkrDll      = 0x00068,	// (104) wdbrkcht.dll
	msoqfidVIM             = 0x00069,	// (105) mapivi32.dll
	msofidMsoHevDll        = 0x0006a,	// (106) msohev.dll
	msofidStemmerDll       = 0x0006b,	// (107) msstko32.dll
	msoqfidEnvelopeIntlDll = 0x0006c,	// (108) envelopr.dll
	msoqfidEnvOutlHelp     = 0x0006d,	// (109) oltip10.hlp
	msoqfidMSQueryTips     = 0x0006e,	// (110) msqry32.hlp
	msofidMssign32Dll      = 0x0006f,	// (111) mssign32.dll
	msoqfidOBalloon        = 0x00070,	// (112) oballoon$d.dll
	msofidOlepro32Dll      = 0x00071,	// (113) OLEPRO32.DLL
	msofidCryptuiDll       = 0x00072,	// (114) cryptui.dll
	msoqfidSpeechGrammars  = 0x00073,	// (115) srintl.dll
	msoqfidSpeechTrainingVideo = 0x00074,	// (116) video.mht
	msoqfidSpeechTrainingText = 0x00075,	// (117) offtext.txt
	msofidSimSunFont       = 0x00076,	// (118) simsun.ttf
	msofidPMingLiUFont     = 0x00077,	// (119) pmingliu.ttf
	msofidCenturyFont      = 0x00078,	// (120) century.ttf
	msofidMsMinchoFont     = 0x00079,	// (121) msmincho.ttf
	msofidBatangCheFont    = 0x0007a,	// (122) batang.ttf
	msofidSetupddDll       = 0x0007b,	// (123) setupdd.dll
	msofidMyPictures       = 0x0007c,	// (124) shfolder.dll
	msofidSimSunTTCFont    = 0x0007d,	// (125) simsun.ttc
	msofidMingLiUTTCFont   = 0x0007e,	// (126) mingliu.ttc
	msofidMsMinchoTTCFont  = 0x0007f,	// (127) msmincho.ttc
	msofidBatangCheTTCFont = 0x00080,	// (128) batang.ttc
	msofidSAExtDll         = 0x00081,	// (129) saext.dll
	msofidCSSeqChkDll      = 0x00082,	// (130) seqchk10.dll
	msofidUcs20Dll         = 0x00083,	// (131) UCS20.DLL
	msofidWdbImpDll        = 0x00084,	// (132) wdbimp.dll
	msofidMsoSvDll         = 0x00085,	// (133) msosv$d.dll
	msoqfidMsoSvIntlDll    = 0x00086,	// (134) msosvint.dll
	msoqfidMsoICCEnRGBCMYK = 0x00087,	// (135) rswop.icm
	msoqfidMsoPantoneDLL   = 0x00088,	// (136) poce98.dll
	msofidCtryInfo         = 0x00089,	// (137) ctryinfo.txt
	msofidLicenseStore     = 0x0008a,	// (138) data.bak
	msoqfidmstoreIntlDLL   = 0x0008b,	// (139) mstintl.dll|MSTIntlD.dll
	msofidmstoreSearchDLL  = 0x0008c,	// (140) mstores.dll|MStoreSD.dll
	msofidActivedsDll      = 0x0008d,	// (141) activeds.dll
	msofidTypeLibFactoid   = 0x0008e,	// (142) mstag.tlb
	msofidViniutilDll      = 0x0008f,	// (143) fpcutl.dll
	msoqfidFPUtlIntlDll    = 0x00090,	// (144) fputlsat.dll
	msoqfidFPPageKey       = 0x00091,	// (145) normal.htm
	msoqfidFPFrameKey      = 0x00092,	// (146) bantoc.htm
	msoqfidFPCSSKey        = 0x00093,	// (147) normal.inf_0002
	msoqfidFPWebKey        = 0x00094,	// (148) empty.inf
	msofidDocumentImagingExe = 0x00095,	// (149) mspview.exe
	msoqfidNavBarStyles    = 0x00096,	// (150) navbars.ini
	msoqfidListViewStyles  = 0x00097,	// (151) lstviews.ini
	msofidVC7Runtime       = 0x00098,	// (152) FL_msvcr70$d_dll_____X86.3643236F_FC70_11D3_A536_0090278A1BB8
	msofidVC7CPPRuntime    = 0x00099,	// (153) FL_msvcp70$d_dll_____X86.3643236F_FC70_11D3_A536_0090278A1BB8
	msofidTcpTest          = 0x0009a,	// (154) tcptest.exe
	msofidVSAnsi           = 0x0009b,	// (155) FL_vsansi_dll_____X86.3643236F_FC70_11D3_A536_0090278A1BB8
	msofidVSAssert         = 0x0009c,	// (156) Vsassert_dll_2_____X86.3643236F_FC70_11D3_A536_0090278A1BB8
	msofidATL70Unicode     = 0x0009d,	// (157) FL_atl70_dll_1_____X86.3643236F_FC70_11D3_A536_0090278A1BB8
	msofidATL70Ansi        = 0x0009e,	// (158) FL_atl70_dll_____X86.3643236F_FC70_11D3_A536_0090278A1BB8
	msofidATL70Debug       = 0x0009f,	// (159) atl70dbg_dll_5_____X86.3643236F_FC70_11D3_A536_0090278A1BB8
	msoqfidmstoreMainHelp  = 0x000a0,	// (160) mstore10.chm
	msoqfidmstoreTipHelp   = 0x000a1,	// (161) mstip10.hlp
	msoqfidmstoreCagCat    = 0x000a2,	// (162) cagcat.mml
	msoqfidmstoreCagCat10  = 0x000a3,	// (163) cagcat10.mml
	msoqfidmstoreOffice10  = 0x000a4,	// (164) office10.mml
	msoqfidMsoOutlcmRDLL   = 0x000a5,	// (165) OutlcmR.dll
	msoqfidDigiDash        = 0x000a6,	// (166) digidash.dll
	msoqfidDiscussion      = 0x000a7,	// (167) discuss.dll
	msoqfidDocLib          = 0x000a8,	// (168) doclib.dll
	msoqfidIssue           = 0x000a9,	// (169) issue.dll
	msoqfidProject         = 0x000aa,	// (170) project.dll
	msoqfidSimpleList      = 0x000ab,	// (171) simple.dll
	msoqfidSurvey          = 0x000ac,	// (172) survey.dll
	msoqfidWorkflow        = 0x000ad,	// (173) workflow.dll
	msofidMOSearchExe      = 0x000ae,	// (174) mosearch.exe
	msofidWtsapi32Dll      = 0x000af,	// (175) wtsapi32.dll
	msofidMediaGallery     = 0x000b0,	// (176) mstore$d.exe
	msofidConverterWord97  = 0x000b1,	// (177) mswrd832.cnv
	msofidConverterCore    = 0x000b2,	// (178) msconv97.dll
};
%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\VSSDK\VisualStudioIntegration\Common\Inc\office10\msotcdar.h(14,0)