Skip to content

Commit c6058bc

Browse files
committed
[ATL] Import Wine upstream patch wine-mirror/wine@3043ab3
Author: Puetz Kevin A <[email protected]> atlbase.h: Fix some declarations on win64. Signed-off-by: Jacek Caban <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]>
1 parent b4b0728 commit c6058bc

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

dll/win32/atl/atl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pE
217217

218218
while (pEntries[i].pFunc != 0)
219219
{
220-
TRACE("Trying entry %i (%s %i %p)\n",i,debugstr_guid(pEntries[i].piid),
220+
TRACE("Trying entry %i (%s %lx %p)\n",i,debugstr_guid(pEntries[i].piid),
221221
pEntries[i].dw, pEntries[i].pFunc);
222222

223223
if (!pEntries[i].piid || IsEqualGUID(iid,pEntries[i].piid))

modules/rostests/winetests/atl/module.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,43 +163,46 @@ static void test_winclassinfo(void)
163163
ok(len == expectedLen, "wci.m_szAutoName has length %d, expected length %d\n", len, expectedLen);
164164
}
165165

166-
static DWORD cb_val;
166+
static DWORD_PTR cb_val;
167167

168-
static void WINAPI term_callback(DWORD dw)
168+
static void WINAPI term_callback(DWORD_PTR dw)
169169
{
170170
cb_val = dw;
171171
}
172172

173173
static void test_term(void)
174174
{
175175
_ATL_MODULEW test;
176+
ULONG_PTR ex;
176177
HRESULT hres;
177178

179+
ex = (ULONG_PTR)-37;
180+
178181
test.cbSize = sizeof(_ATL_MODULEW);
179182

180183
hres = AtlModuleInit(&test, NULL, NULL);
181-
ok (hres == S_OK, "AtlModuleInit failed (0x%x).\n", (int)hres);
184+
ok (hres == S_OK, "AtlModuleInit failed (0x%x).\n", hres);
182185

183-
hres = AtlModuleAddTermFunc(&test, term_callback, 0x22);
184-
ok (hres == S_OK, "AtlModuleAddTermFunc failed (0x%x).\n", (int)hres);
186+
hres = AtlModuleAddTermFunc(&test, term_callback, ex);
187+
ok (hres == S_OK, "AtlModuleAddTermFunc failed (0x%x).\n", hres);
185188

186189
cb_val = 0xdeadbeef;
187190
hres = AtlModuleTerm(&test);
188-
ok (hres == S_OK, "AtlModuleTerm failed (0x%x).\n", (int)hres);
189-
ok (cb_val == 0x22, "wrong callback value (0x%x).\n", (int)cb_val);
191+
ok (hres == S_OK, "AtlModuleTerm failed (0x%x).\n", hres);
192+
ok (cb_val == ex, "wrong callback value (0x%lx).\n", cb_val);
190193

191194
test.cbSize = FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer);
192195

193196
hres = AtlModuleInit(&test, NULL, NULL);
194-
ok (hres == S_OK, "AtlModuleInit failed (0x%x).\n", (int)hres);
197+
ok (hres == S_OK, "AtlModuleInit failed (0x%x).\n", hres);
195198

196199
hres = AtlModuleAddTermFunc(&test, term_callback, 0x23);
197-
ok (hres == S_OK, "AtlModuleAddTermFunc failed (0x%x).\n", (int)hres);
200+
ok (hres == S_OK, "AtlModuleAddTermFunc failed (0x%x).\n", hres);
198201

199202
cb_val = 0xdeadbeef;
200203
hres = AtlModuleTerm(&test);
201-
ok (hres == S_OK, "AtlModuleTerm failed (0x%x).\n", (int)hres);
202-
ok (cb_val == 0xdeadbeef, "wrong callback value (0x%x).\n", (int)cb_val);
204+
ok (hres == S_OK, "AtlModuleTerm failed (0x%x).\n", hres);
205+
ok (cb_val == 0xdeadbeef, "wrong callback value (0x%lx).\n", cb_val);
203206
}
204207

205208
START_TEST(module)

sdk/include/reactos/wine/atlbase.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
#endif
3838

3939
typedef HRESULT (WINAPI _ATL_CREATORFUNC)(void* pv, REFIID riid, LPVOID* ppv);
40-
typedef HRESULT (WINAPI _ATL_CREATORARGFUNC)(void* pv, REFIID riid, LPVOID* ppv, DWORD dw);
41-
typedef HRESULT (WINAPI _ATL_MODULEFUNC)(DWORD dw);
40+
typedef HRESULT (WINAPI _ATL_CREATORARGFUNC)(void* pv, REFIID riid, LPVOID* ppv, DWORD_PTR dw);
41+
typedef HRESULT (WINAPI _ATL_MODULEFUNC)(DWORD_PTR dw);
4242
typedef LPCSTR (WINAPI _ATL_DESCRIPTIONFUNCA)(void);
4343
typedef LPCWSTR (WINAPI _ATL_DESCRIPTIONFUNCW)(void);
4444
typedef const struct _ATL_CATMAP_ENTRY* (_ATL_CATMAPFUNC)(void);
45-
typedef void (WINAPI _ATL_TERMFUNC)(DWORD dw);
45+
typedef void (WINAPI _ATL_TERMFUNC)(DWORD_PTR dw);
4646

4747
typedef CRITICAL_SECTION CComCriticalSection;
4848

@@ -234,7 +234,7 @@ typedef _ATL_MODULEW _ATL_WIN_MODULE;
234234
typedef struct _ATL_INTMAP_ENTRY_TAG
235235
{
236236
const IID* piid;
237-
DWORD dw;
237+
DWORD_PTR dw;
238238
_ATL_CREATORARGFUNC* pFunc;
239239
} _ATL_INTMAP_ENTRY;
240240

0 commit comments

Comments
 (0)