mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +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
|
||||
(
|
||||
HACCEL hAccelSrc,
|
||||
LPACCEL lpAccelDst,
|
||||
LPACCEL lpAccelDst, /* can be NULL */
|
||||
int cAccelEntries
|
||||
)
|
||||
{
|
||||
int i;
|
||||
|
||||
cAccelEntries = CopyAcceleratorTableW(hAccelSrc, lpAccelDst, cAccelEntries);
|
||||
int i;
|
||||
|
||||
if(cAccelEntries == 0) return 0;
|
||||
cAccelEntries = CopyAcceleratorTableW(hAccelSrc, lpAccelDst, cAccelEntries);
|
||||
|
||||
if (lpAccelDst == NULL) return cAccelEntries;
|
||||
|
||||
for(i = 0; i < cAccelEntries; ++ i)
|
||||
if(!(lpAccelDst[i].fVirt & FVIRTKEY))
|
||||
{
|
||||
NTSTATUS nErrCode = RtlUnicodeToMultiByteN
|
||||
(
|
||||
(PCHAR)&lpAccelDst[i].key,
|
||||
sizeof(lpAccelDst[i].key),
|
||||
NULL,
|
||||
(PWCHAR)&lpAccelDst[i].key,
|
||||
sizeof(lpAccelDst[i].key)
|
||||
);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode)) lpAccelDst[i].key = 0;
|
||||
}
|
||||
|
||||
return cAccelEntries;
|
||||
for(i = 0; i < cAccelEntries; ++ i)
|
||||
if(!(lpAccelDst[i].fVirt & FVIRTKEY))
|
||||
{
|
||||
NTSTATUS nErrCode = RtlUnicodeToMultiByteN(
|
||||
(PCHAR)&lpAccelDst[i].key,
|
||||
sizeof(lpAccelDst[i].key),
|
||||
NULL,
|
||||
(PWCHAR)&lpAccelDst[i].key,
|
||||
sizeof(lpAccelDst[i].key)
|
||||
);
|
||||
|
||||
if(!NT_SUCCESS(nErrCode)) lpAccelDst[i].key = 0;
|
||||
}
|
||||
|
||||
return cAccelEntries;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue