mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
CopyAcceleratorTableA: dont access lpAccelDst it its NULL (w3seek)
svn path=/trunk/; revision=14254
This commit is contained in:
parent
0ac49e9d42
commit
4dcc066ed7
1 changed files with 20 additions and 24 deletions
|
@ -285,38 +285,34 @@ HACCEL WINAPI CreateAcceleratorTableW(LPACCEL lpaccl, int cEntries)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
int WINAPI CopyAcceleratorTableA
|
int WINAPI CopyAcceleratorTableA
|
||||||
(
|
(
|
||||||
HACCEL hAccelSrc,
|
HACCEL hAccelSrc,
|
||||||
LPACCEL lpAccelDst,
|
LPACCEL lpAccelDst, /* can be NULL */
|
||||||
int cAccelEntries
|
int cAccelEntries
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
cAccelEntries = CopyAcceleratorTableW(hAccelSrc, lpAccelDst, cAccelEntries);
|
|
||||||
|
|
||||||
if(cAccelEntries == 0) return 0;
|
cAccelEntries = CopyAcceleratorTableW(hAccelSrc, lpAccelDst, cAccelEntries);
|
||||||
|
|
||||||
|
if (lpAccelDst == NULL) return cAccelEntries;
|
||||||
|
|
||||||
for(i = 0; i < cAccelEntries; ++ i)
|
for(i = 0; i < cAccelEntries; ++ i)
|
||||||
if(!(lpAccelDst[i].fVirt & FVIRTKEY))
|
if(!(lpAccelDst[i].fVirt & FVIRTKEY))
|
||||||
{
|
{
|
||||||
NTSTATUS nErrCode = RtlUnicodeToMultiByteN
|
NTSTATUS nErrCode = RtlUnicodeToMultiByteN(
|
||||||
(
|
(PCHAR)&lpAccelDst[i].key,
|
||||||
(PCHAR)&lpAccelDst[i].key,
|
sizeof(lpAccelDst[i].key),
|
||||||
sizeof(lpAccelDst[i].key),
|
NULL,
|
||||||
NULL,
|
(PWCHAR)&lpAccelDst[i].key,
|
||||||
(PWCHAR)&lpAccelDst[i].key,
|
sizeof(lpAccelDst[i].key)
|
||||||
sizeof(lpAccelDst[i].key)
|
);
|
||||||
);
|
|
||||||
|
if(!NT_SUCCESS(nErrCode)) lpAccelDst[i].key = 0;
|
||||||
if(!NT_SUCCESS(nErrCode)) lpAccelDst[i].key = 0;
|
}
|
||||||
}
|
|
||||||
|
return cAccelEntries;
|
||||||
return cAccelEntries;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue