Artifact 0951e85dcd3ca05416565b895e262c28593018b0:
- File
src/win32/comcat.d
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
The problem was __gshared. Replacing it with TLS fixed the issue. Remaining problem is that "hack.d"'s CloseHandle hack is not working anymore.
(user: kinaba) [annotate]
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
0000: 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a /***************
0010: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0020: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0030: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
0040: 2a 2a 2a 2a 2a 2a 2a 2a 5c 0d 0a 2a 20 20 20 20 ********\..*
0050: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0060: 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6d 63 comc
0070: 61 74 2e 64 20 20 20 20 20 20 20 20 20 20 20 20 at.d
0080: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0090: 20 20 20 2a 0d 0a 2a 20 20 20 20 20 20 20 20 20 *..*
00a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
00b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
00c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
00d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 0d *.
00e0: 0a 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .*
00f0: 20 20 20 20 20 20 20 20 20 57 69 6e 64 6f 77 73 Windows
0100: 20 41 50 49 20 68 65 61 64 65 72 20 6d 6f 64 75 API header modu
0110: 6c 65 20 20 20 20 20 20 20 20 20 20 20 20 20 20 le
0120: 20 20 20 20 20 20 20 20 20 2a 0d 0a 2a 20 20 20 *..*
0130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0140: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0150: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0160: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0170: 20 20 20 20 2a 0d 0a 2a 20 20 20 20 20 20 20 20 *..*
0180: 20 20 20 20 20 20 20 20 20 54 72 61 6e 73 6c 61 Transla
0190: 74 65 64 20 66 72 6f 6d 20 4d 69 6e 47 57 20 57 ted from MinGW W
01a0: 69 6e 64 6f 77 73 20 68 65 61 64 65 72 73 20 20 indows headers
01b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a *
01c0: 0d 0a 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 ..*
01d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 79 by
01e0: 20 53 74 65 77 61 72 74 20 47 6f 72 64 6f 6e 20 Stewart Gordon
01f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0200: 20 20 20 20 20 20 20 20 20 20 2a 0d 0a 2a 20 20 *..*
0210: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0220: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0230: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0240: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0250: 20 20 20 20 20 2a 0d 0a 2a 20 20 20 20 20 20 20 *..*
0260: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0270: 50 6c 61 63 65 64 20 69 6e 74 6f 20 70 75 62 6c Placed into publ
0280: 69 63 20 64 6f 6d 61 69 6e 20 20 20 20 20 20 20 ic domain
0290: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
02a0: 2a 0d 0a 5c 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a *..\************
02b0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
02c0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
02d0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ****************
02e0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2f 0d 0a 6d 6f ***********/..mo
02f0: 64 75 6c 65 20 77 69 6e 33 32 2e 63 6f 6d 63 61 dule win32.comca
0300: 74 3b 0d 0a 0d 0a 69 6d 70 6f 72 74 20 77 69 6e t;....import win
0310: 33 32 2e 77 69 6e 64 6f 77 73 2c 20 77 69 6e 33 32.windows, win3
0320: 32 2e 6f 6c 65 32 3b 0d 0a 70 72 69 76 61 74 65 2.ole2;..private
0330: 20 69 6d 70 6f 72 74 20 77 69 6e 33 32 2e 62 61 import win32.ba
0340: 73 65 74 79 70 73 2c 20 77 69 6e 33 32 2e 63 67 setyps, win32.cg
0350: 75 69 64 2c 20 77 69 6e 33 32 2e 6f 62 6a 62 61 uid, win32.objba
0360: 73 65 2c 20 77 69 6e 33 32 2e 75 6e 6b 6e 77 6e se, win32.unknwn
0370: 2c 0d 0a 20 20 77 69 6e 33 32 2e 77 69 6e 64 65 ,.. win32.winde
0380: 66 2c 20 77 69 6e 33 32 2e 77 74 79 70 65 73 3b f, win32.wtypes;
0390: 0d 0a 0d 0a 61 6c 69 61 73 20 49 45 6e 75 6d 47 ....alias IEnumG
03a0: 55 49 44 20 4c 50 45 4e 55 4d 47 55 49 44 3b 0d UID LPENUMGUID;.
03b0: 0a 0d 0a 69 6e 74 65 72 66 61 63 65 20 49 45 6e ...interface IEn
03c0: 75 6d 47 55 49 44 20 3a 20 49 55 6e 6b 6e 6f 77 umGUID : IUnknow
03d0: 6e 20 7b 0d 0a 09 48 52 45 53 55 4c 54 20 4e 65 n {...HRESULT Ne
03e0: 78 74 28 55 4c 4f 4e 47 2c 20 47 55 49 44 2a 2c xt(ULONG, GUID*,
03f0: 20 55 4c 4f 4e 47 2a 29 3b 0d 0a 09 48 52 45 53 ULONG*);...HRES
0400: 55 4c 54 20 53 6b 69 70 28 55 4c 4f 4e 47 29 3b ULT Skip(ULONG);
0410: 0d 0a 09 48 52 45 53 55 4c 54 20 52 65 73 65 74 ...HRESULT Reset
0420: 28 29 3b 0d 0a 09 48 52 45 53 55 4c 54 20 43 6c ();...HRESULT Cl
0430: 6f 6e 65 28 4c 50 45 4e 55 4d 47 55 49 44 2a 29 one(LPENUMGUID*)
0440: 3b 0d 0a 7d 0d 0a 0d 0a 61 6c 69 61 73 20 47 55 ;..}....alias GU
0450: 49 44 20 43 41 54 49 44 3b 0d 0a 61 6c 69 61 73 ID CATID;..alias
0460: 20 52 45 46 47 55 49 44 20 52 45 46 43 41 54 49 REFGUID REFCATI
0470: 44 3b 0d 0a 61 6c 69 61 73 20 47 55 49 44 5f 4e D;..alias GUID_N
0480: 55 4c 4c 20 43 41 54 49 44 5f 4e 55 4c 4c 3b 0d ULL CATID_NULL;.
0490: 0a 61 6c 69 61 73 20 49 73 45 71 75 61 6c 47 55 .alias IsEqualGU
04a0: 49 44 20 49 73 45 71 75 61 6c 43 41 54 49 44 3b ID IsEqualCATID;
04b0: 0d 0a 0d 0a 73 74 72 75 63 74 20 43 41 54 45 47 ....struct CATEG
04c0: 4f 52 59 49 4e 46 4f 20 7b 0d 0a 09 43 41 54 49 ORYINFO {...CATI
04d0: 44 20 20 20 20 20 20 20 20 63 61 74 69 64 3b 0d D catid;.
04e0: 0a 09 4c 43 49 44 20 20 20 20 20 20 20 20 20 6c ..LCID l
04f0: 63 69 64 3b 0d 0a 09 4f 4c 45 43 48 41 52 5b 31 cid;...OLECHAR[1
0500: 32 38 5d 20 73 7a 44 65 73 63 72 69 70 74 69 6f 28] szDescriptio
0510: 6e 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 43 41 54 n;..}..alias CAT
0520: 45 47 4f 52 59 49 4e 46 4f 2a 20 4c 50 43 41 54 EGORYINFO* LPCAT
0530: 45 47 4f 52 59 49 4e 46 4f 3b 0d 0a 0d 0a 61 6c EGORYINFO;....al
0540: 69 61 73 20 49 45 6e 75 6d 47 55 49 44 20 49 45 ias IEnumGUID IE
0550: 6e 75 6d 43 41 54 49 44 3b 0d 0a 61 6c 69 61 73 numCATID;..alias
0560: 20 4c 50 45 4e 55 4d 47 55 49 44 20 4c 50 45 4e LPENUMGUID LPEN
0570: 55 4d 43 41 54 49 44 3b 0d 0a 61 6c 69 61 73 20 UMCATID;..alias
0580: 49 49 44 5f 49 45 6e 75 6d 47 55 49 44 20 49 49 IID_IEnumGUID II
0590: 44 5f 49 45 6e 75 6d 43 41 54 49 44 3b 0d 0a 0d D_IEnumCATID;...
05a0: 0a 61 6c 69 61 73 20 49 45 6e 75 6d 47 55 49 44 .alias IEnumGUID
05b0: 20 49 45 6e 75 6d 43 4c 53 49 44 3b 0d 0a 61 6c IEnumCLSID;..al
05c0: 69 61 73 20 4c 50 45 4e 55 4d 47 55 49 44 20 4c ias LPENUMGUID L
05d0: 50 45 4e 55 4d 43 4c 53 49 44 3b 0d 0a 61 6c 69 PENUMCLSID;..ali
05e0: 61 73 20 49 49 44 5f 49 45 6e 75 6d 47 55 49 44 as IID_IEnumGUID
05f0: 20 49 49 44 5f 49 45 6e 75 6d 43 4c 53 49 44 3b IID_IEnumCLSID;
0600: 0d 0a 0d 0a 69 6e 74 65 72 66 61 63 65 20 49 43 ....interface IC
0610: 61 74 49 6e 66 6f 72 6d 61 74 69 6f 6e 20 3a 20 atInformation :
0620: 49 55 6e 6b 6e 6f 77 6e 20 7b 0d 0a 09 48 52 45 IUnknown {...HRE
0630: 53 55 4c 54 20 45 6e 75 6d 43 61 74 65 67 6f 72 SULT EnumCategor
0640: 69 65 73 28 4c 43 49 44 2c 20 4c 50 45 4e 55 4d ies(LCID, LPENUM
0650: 43 41 54 45 47 4f 52 59 49 4e 46 4f 2a 29 3b 0d CATEGORYINFO*);.
0660: 0a 09 48 52 45 53 55 4c 54 20 47 65 74 43 61 74 ..HRESULT GetCat
0670: 65 67 6f 72 79 44 65 73 63 28 52 45 46 43 41 54 egoryDesc(REFCAT
0680: 49 44 2c 20 4c 43 49 44 2c 20 50 57 43 48 41 52 ID, LCID, PWCHAR
0690: 2a 29 3b 0d 0a 09 48 52 45 53 55 4c 54 20 45 6e *);...HRESULT En
06a0: 75 6d 43 6c 61 73 73 65 73 4f 66 43 61 74 65 67 umClassesOfCateg
06b0: 6f 72 69 65 73 28 55 4c 4f 4e 47 2c 20 43 41 54 ories(ULONG, CAT
06c0: 49 44 2a 2c 20 55 4c 4f 4e 47 2c 20 43 41 54 49 ID*, ULONG, CATI
06d0: 44 2a 2c 0d 0a 09 20 20 4c 50 45 4e 55 4d 43 4c D*,... LPENUMCL
06e0: 53 49 44 2a 29 3b 0d 0a 09 48 52 45 53 55 4c 54 SID*);...HRESULT
06f0: 20 49 73 43 6c 61 73 73 4f 66 43 61 74 65 67 6f IsClassOfCatego
0700: 72 69 65 73 28 52 45 46 43 4c 53 49 44 2c 20 55 ries(REFCLSID, U
0710: 4c 4f 4e 47 2c 20 43 41 54 49 44 2a 2c 20 55 4c LONG, CATID*, UL
0720: 4f 4e 47 2c 20 43 41 54 49 44 2a 29 3b 0d 0a 09 ONG, CATID*);...
0730: 48 52 45 53 55 4c 54 20 45 6e 75 6d 49 6d 70 6c HRESULT EnumImpl
0740: 43 61 74 65 67 6f 72 69 65 73 4f 66 43 6c 61 73 CategoriesOfClas
0750: 73 28 52 45 46 43 4c 53 49 44 2c 20 4c 50 45 4e s(REFCLSID, LPEN
0760: 55 4d 43 41 54 49 44 2a 29 3b 0d 0a 09 48 52 45 UMCATID*);...HRE
0770: 53 55 4c 54 20 45 6e 75 6d 52 65 71 43 61 74 65 SULT EnumReqCate
0780: 67 6f 72 69 65 73 4f 66 43 6c 61 73 73 28 52 45 goriesOfClass(RE
0790: 46 43 4c 53 49 44 2c 20 4c 50 45 4e 55 4d 43 41 FCLSID, LPENUMCA
07a0: 54 49 44 2a 29 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 TID*);..}..alias
07b0: 20 49 43 61 74 49 6e 66 6f 72 6d 61 74 69 6f 6e ICatInformation
07c0: 20 4c 50 43 41 54 49 4e 46 4f 52 4d 41 54 49 4f LPCATINFORMATIO
07d0: 4e 3b 0d 0a 0d 0a 69 6e 74 65 72 66 61 63 65 20 N;....interface
07e0: 49 43 61 74 52 65 67 69 73 74 65 72 20 3a 20 49 ICatRegister : I
07f0: 55 6e 6b 6e 6f 77 6e 20 7b 0d 0a 09 48 52 45 53 Unknown {...HRES
0800: 55 4c 54 20 52 65 67 69 73 74 65 72 43 61 74 65 ULT RegisterCate
0810: 67 6f 72 69 65 73 28 55 4c 4f 4e 47 2c 20 43 41 gories(ULONG, CA
0820: 54 45 47 4f 52 59 49 4e 46 4f 2a 29 3b 0d 0a 09 TEGORYINFO*);...
0830: 48 52 45 53 55 4c 54 20 55 6e 52 65 67 69 73 74 HRESULT UnRegist
0840: 65 72 43 61 74 65 67 6f 72 69 65 73 28 55 4c 4f erCategories(ULO
0850: 4e 47 2c 20 43 41 54 49 44 2a 29 3b 0d 0a 09 48 NG, CATID*);...H
0860: 52 45 53 55 4c 54 20 52 65 67 69 73 74 65 72 43 RESULT RegisterC
0870: 6c 61 73 73 49 6d 70 6c 43 61 74 65 67 6f 72 69 lassImplCategori
0880: 65 73 28 52 45 46 43 4c 53 49 44 2c 20 55 4c 4f es(REFCLSID, ULO
0890: 4e 47 2c 20 43 41 54 49 44 2a 29 3b 0d 0a 09 48 NG, CATID*);...H
08a0: 52 45 53 55 4c 54 20 55 6e 52 65 67 69 73 74 65 RESULT UnRegiste
08b0: 72 43 6c 61 73 73 49 6d 70 6c 43 61 74 65 67 6f rClassImplCatego
08c0: 72 69 65 73 28 52 45 46 43 4c 53 49 44 2c 20 55 ries(REFCLSID, U
08d0: 4c 4f 4e 47 2c 20 43 41 54 49 44 2a 29 3b 0d 0a LONG, CATID*);..
08e0: 09 48 52 45 53 55 4c 54 20 52 65 67 69 73 74 65 .HRESULT Registe
08f0: 72 43 6c 61 73 73 52 65 71 43 61 74 65 67 6f 72 rClassReqCategor
0900: 69 65 73 28 52 45 46 43 4c 53 49 44 2c 20 55 4c ies(REFCLSID, UL
0910: 4f 4e 47 2c 20 43 41 54 49 44 2a 29 3b 0d 0a 09 ONG, CATID*);...
0920: 48 52 45 53 55 4c 54 20 55 6e 52 65 67 69 73 74 HRESULT UnRegist
0930: 65 72 43 6c 61 73 73 52 65 71 43 61 74 65 67 6f erClassReqCatego
0940: 72 69 65 73 28 52 45 46 43 4c 53 49 44 2c 20 55 ries(REFCLSID, U
0950: 4c 4f 4e 47 2c 20 43 41 54 49 44 2a 29 3b 0d 0a LONG, CATID*);..
0960: 7d 0d 0a 61 6c 69 61 73 20 49 43 61 74 52 65 67 }..alias ICatReg
0970: 69 73 74 65 72 20 4c 50 43 41 54 52 45 47 49 53 ister LPCATREGIS
0980: 54 45 52 3b 0d 0a 0d 0a 69 6e 74 65 72 66 61 63 TER;....interfac
0990: 65 20 49 45 6e 75 6d 43 41 54 45 47 4f 52 59 49 e IEnumCATEGORYI
09a0: 4e 46 4f 20 3a 20 49 55 6e 6b 6e 6f 77 6e 20 7b NFO : IUnknown {
09b0: 0d 0a 09 48 52 45 53 55 4c 54 20 4e 65 78 74 28 ...HRESULT Next(
09c0: 55 4c 4f 4e 47 2c 20 43 41 54 45 47 4f 52 59 49 ULONG, CATEGORYI
09d0: 4e 46 4f 2a 2c 20 55 4c 4f 4e 47 2a 29 3b 0d 0a NFO*, ULONG*);..
09e0: 09 48 52 45 53 55 4c 54 20 53 6b 69 70 28 55 4c .HRESULT Skip(UL
09f0: 4f 4e 47 29 3b 0d 0a 09 48 52 45 53 55 4c 54 20 ONG);...HRESULT
0a00: 52 65 73 65 74 28 29 3b 0d 0a 09 48 52 45 53 55 Reset();...HRESU
0a10: 4c 54 20 43 6c 6f 6e 65 28 4c 50 45 4e 55 4d 43 LT Clone(LPENUMC
0a20: 41 54 45 47 4f 52 59 49 4e 46 4f 2a 29 3b 0d 0a ATEGORYINFO*);..
0a30: 7d 0d 0a 61 6c 69 61 73 20 49 45 6e 75 6d 43 41 }..alias IEnumCA
0a40: 54 45 47 4f 52 59 49 4e 46 4f 20 4c 50 45 4e 55 TEGORYINFO LPENU
0a50: 4d 43 41 54 45 47 4f 52 59 49 4e 46 4f 3b 0d 0a MCATEGORYINFO;..