mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 22:43:01 +00:00
[ipconfig] Respect the size parameter in the LoadStringAndOem helper function, fixes "ipconfig /?"
See issue #6146 for more details. svn path=/trunk/; revision=51434
This commit is contained in:
parent
63bd3c88e9
commit
6a89b41bff
1 changed files with 14 additions and 6 deletions
|
@ -28,13 +28,21 @@ HANDLE ProcessHeap;
|
||||||
int LoadStringAndOem(HINSTANCE hInst,
|
int LoadStringAndOem(HINSTANCE hInst,
|
||||||
UINT uID,
|
UINT uID,
|
||||||
LPTSTR szNode,
|
LPTSTR szNode,
|
||||||
int Siz
|
int byteSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
TCHAR szTmp[25];
|
TCHAR *szTmp;
|
||||||
int res = LoadString(hInst, uID, szTmp, sizeof(szTmp));
|
int res;
|
||||||
|
|
||||||
|
szTmp = (LPTSTR)HeapAlloc(ProcessHeap, 0, byteSize);
|
||||||
|
if (szTmp == NULL)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
res = LoadString(hInst, uID, szTmp, byteSize);
|
||||||
CharToOem(szTmp, szNode);
|
CharToOem(szTmp, szNode);
|
||||||
return(res);
|
HeapFree(ProcessHeap, 0, szTmp);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
LPTSTR GetNodeTypeName(UINT NodeType)
|
LPTSTR GetNodeTypeName(UINT NodeType)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue