Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #820 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

HKEY_CLASSES_ROOT = (0x80000000), should be HKEY_CLASSES_ROOT = cast(HKEY) (0x80000000)

Reported by: yidabu Assigned to: kris
Priority: normal Milestone: 0.99.6
Component: Tango Version: 0.99.3 Triller
Keywords: Registry Cc:

Description (Last modified by yidabu)

Types.di

    HKEY_CLASSES_ROOT = (0x80000000),
    HKEY_CURRENT_USER = (0x80000001),
    HKEY_LOCAL_MACHINE = (0x80000002),
    HKEY_USERS = (0x80000003),
    HKEY_PERFORMANCE_DATA = (0x80000004),
    HKEY_CURRENT_CONFIG = (0x80000005),
    HKEY_DYN_DATA = (0x80000006),

should be

HKEY HKEY_CLASSES_ROOT = cast(HKEY)(0x80000000),
...

see: http://msdn2.microsoft.com/en-us/library/aa383751.aspx

HKEY Handle to a registry key.

This type is declared in WinDef?.h as follows: typedef HANDLE HKEY;

http://msdn2.microsoft.com/en-us/library/ms724897.aspx

and

  REG_OPTION_VOLATILE = (0x1),
    REG_OPTION_NON_VOLATILE = (0),
    REG_CREATED_NEW_KEY = (0x1),
    REG_OPENED_EXISTING_KEY = (0x2),
    REG_BINARY = (3),
    REG_DWORD = (4),
    REG_DWORD_LITTLE_ENDIAN = (4),
    REG_DWORD_BIG_ENDIAN = (5),
    REG_EXPAND_SZ = (2),
    REG_FULL_RESOURCE_DESCRIPTOR = (9),
    REG_LINK = (6),
    REG_MULTI_SZ = (7),
    REG_NONE = (0),
    REG_RESOURCE_LIST = (8),
    REG_RESOURCE_REQUIREMENTS_LIST = (10),
    REG_SZ = (1),

should be

REG_NONE                    = ( 0 ),   // No value type
REG_SZ                      = ( 1 ),   // Unicode nul terminated string
REG_EXPAND_SZ               = ( 2 ),   // Unicode nul terminated string
                                            // = (with environment variable references)
REG_BINARY                  = ( 3 ),   // Free form binary
REG_DWORD                   = ( 4 ),   // 32-bit number
REG_DWORD_LITTLE_ENDIAN     = ( 4 ),   // 32-bit number = (same as REG_DWORD)
REG_DWORD_BIG_ENDIAN        = ( 5 ),   // 32-bit number
REG_LINK                    = ( 6 ),   // Symbolic Link = (unicode)
REG_MULTI_SZ                = ( 7 ),   // Multiple Unicode strings
REG_RESOURCE_LIST           = ( 8 ),   // Resource list in the resource map
REG_FULL_RESOURCE_DESCRIPTOR = ( 9 ),  // Resource list in the hardware description
REG_RESOURCE_REQUIREMENTS_LIST = ( 10 ),
REG_QWORD                   = ( 11 ),  // 64-bit number
REG_QWORD_LITTLE_ENDIAN     = ( 11 ),  // 64-bit number = (same as REG_QWORD)

see: http://msdn2.microsoft.com/en-us/library/ms724884.aspx

The C++ version(from VC8 SDK WinNt?.h)

#define REG_NONE                    ( 0 )   // No value type
#define REG_SZ                      ( 1 )   // Unicode nul terminated string
#define REG_EXPAND_SZ               ( 2 )   // Unicode nul terminated string
                                            // (with environment variable references)
#define REG_BINARY                  ( 3 )   // Free form binary
#define REG_DWORD                   ( 4 )   // 32-bit number
#define REG_DWORD_LITTLE_ENDIAN     ( 4 )   // 32-bit number (same as REG_DWORD)
#define REG_DWORD_BIG_ENDIAN        ( 5 )   // 32-bit number
#define REG_LINK                    ( 6 )   // Symbolic Link (unicode)
#define REG_MULTI_SZ                ( 7 )   // Multiple Unicode strings
#define REG_RESOURCE_LIST           ( 8 )   // Resource list in the resource map
#define REG_FULL_RESOURCE_DESCRIPTOR ( 9 )  // Resource list in the hardware description
#define REG_RESOURCE_REQUIREMENTS_LIST ( 10 )
#define REG_QWORD                   ( 11 )  // 64-bit number
#define REG_QWORD_LITTLE_ENDIAN     ( 11 )  // 64-bit number (same as REG_QWORD)

Reported by warker at DWin forum: http://www.dsource.org/forums/viewtopic.php?t=3440

Please add these definition to Types.di (from DWin Types.d):


/**
    See_Also:
    http://msdn2.microsoft.com/en-us/library/aa768360.aspx
    added by yidabu
    Header Exdisp.h 
*/
enum : DWORD
{
    navOpenInNewWindow = 0x1,
    navNoHistory = 0x2,
    navNoReadFromCache = 0x4,
    navNoWriteToCache = 0x8,
    navAllowAutosearch = 0x10,
    navBrowserBar = 0x20,
    navHyperlink = 0x40,
    navEnforceRestricted = 0x80,
    navNewWindowsManaged = 0x0100,
    navUntrustedForDownload = 0x0200,
    navTrustedForActiveX = 0x0400,
    navOpenInNewTab = 0x0800,
    navOpenInBackgroundTab = 0x1000,
    navKeepWordWheelText = 0x2000
} 



//added by yidabu 20071005
// http://msdn2.microsoft.com/en-us/library/aa380337.aspx
// from win32.objbase
// for IPersistMoniker
enum : DWORD
{
    STGM_DIRECT           = 0,
    STGM_TRANSACTED       = 0x10000L,
    STGM_SIMPLE           = 0x8000000L,
    STGM_READ             = 0,
    STGM_WRITE            = 1,
    STGM_READWRITE        = 2,
    STGM_SHARE_DENY_NONE  = 0x40,
    STGM_SHARE_DENY_READ  = 0x30,
    STGM_SHARE_DENY_WRITE = 0x20,
    STGM_SHARE_EXCLUSIVE  = 0x10,
    STGM_PRIORITY         = 0x40000L,
    STGM_DELETEONRELEASE  = 0x4000000,
    STGM_NOSCRATCH        = 0x100000,
    STGM_CREATE           = 0x1000,
    STGM_CONVERT          = 0x20000,
    STGM_NOSNAPSHOT       = 0x200000,
    STGM_FAILIFTHERE      = 0
}

//  http://msdn2.microsoft.com/en-us/library/ms690160.aspx
//  OLECONTF contains a set of bitwise constants used in the IOleContainer::EnumObjects method. 
enum : DWORD
{ 
    OLECONTF_EMBEDDINGS    = 1, 
    OLECONTF_LINKS         = 2, 
    OLECONTF_OTHERS        = 4, 
    OLECONTF_ONLYUSER      = 8, 
    OLECONTF_ONLYIFRUNNING = 16
}
//


Change History

12/17/07 04:36:28 changed by yidabu

  • description changed.

12/17/07 20:34:43 changed by kris

  • milestone changed from 0.99.4 to 0.99.5.

hrm .. this is a bit tricky, since they're currently enums. Making them const instead takes up space in the executable, which is kinda silly. Let's wait until the current noise in the D newsgroup over this draws some kind of conclusion, since it is related

12/18/07 23:54:14 changed by yidabu

  • description changed.

Thanks, they are enum now.

how about the wrong definition of HKEY_CLASSES_ROOT = (0x80000000)... in Types.di ?

02/11/08 02:38:28 changed by kris

  • status changed from new to assigned.
  • milestone changed from 0.99.5 to 0.99.6.

That's the problem : we want them to be enum, but enum cannot support void* as a constant type. Really don't want to make then const values instead, since those take up space instead of being true manifest values.

frustrating ...

03/06/08 00:47:43 changed by yidabu

Please comment out the incorrect type definitions, not more means and conflicts with correct one ( that tango based code)

    HKEY_CLASSES_ROOT = (0x80000000),
    HKEY_CURRENT_USER = (0x80000001),
    HKEY_LOCAL_MACHINE = (0x80000002),
    HKEY_USERS = (0x80000003),
    HKEY_PERFORMANCE_DATA = (0x80000004),
    HKEY_CURRENT_CONFIG = (0x80000005),
    HKEY_DYN_DATA = (0x80000006),

03/15/08 19:00:01 changed by kris

(In [3359]) removed HKEY values for now, since they are wrong (see #820)

03/15/08 19:01:47 changed by kris

  • status changed from assigned to closed.
  • resolution set to fixed.

I'm going to close this for now, and will reopen when the const debacle is resolved