mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:25:45 +00:00
only write out key/values in the lpSettings struct
svn path=/trunk/; revision=30235
This commit is contained in:
parent
c8c186109e
commit
b2b76c26a3
1 changed files with 27 additions and 20 deletions
|
@ -79,32 +79,39 @@ WriteRdpFile(HANDLE hFile,
|
||||||
WCHAR line[MAXKEY + MAXVALUE + 4];
|
WCHAR line[MAXKEY + MAXVALUE + 4];
|
||||||
DWORD BytesToWrite, BytesWritten;
|
DWORD BytesToWrite, BytesWritten;
|
||||||
BOOL bRet;
|
BOOL bRet;
|
||||||
INT i;
|
INT i, k;
|
||||||
|
|
||||||
for (i = 0; i < pRdpSettings->NumSettings; i++)
|
for (i = 0; i < pRdpSettings->NumSettings; i++)
|
||||||
{
|
{
|
||||||
if (pRdpSettings->pSettings[i].Type == L'i')
|
/* only write out values in the lpSettings struct */
|
||||||
|
for (k = 0; k < NUM_SETTINGS; k++)
|
||||||
{
|
{
|
||||||
_snwprintf(line, MAXKEY + MAXVALUE + 4, L"%s:i:%d\r\n",
|
if (wcscmp(lpSettings[k], pRdpSettings->pSettings[i].Key) == 0)
|
||||||
pRdpSettings->pSettings[i].Key,
|
{
|
||||||
pRdpSettings->pSettings[i].Value.i);
|
if (pRdpSettings->pSettings[i].Type == L'i')
|
||||||
}
|
{
|
||||||
else
|
_snwprintf(line, MAXKEY + MAXVALUE + 4, L"%s:i:%d\r\n",
|
||||||
{
|
pRdpSettings->pSettings[i].Key,
|
||||||
_snwprintf(line, MAXKEY + MAXVALUE + 4, L"%s:s:%s\r\n",
|
pRdpSettings->pSettings[i].Value.i);
|
||||||
pRdpSettings->pSettings[i].Key,
|
}
|
||||||
pRdpSettings->pSettings[i].Value.s);
|
else
|
||||||
}
|
{
|
||||||
|
_snwprintf(line, MAXKEY + MAXVALUE + 4, L"%s:s:%s\r\n",
|
||||||
|
pRdpSettings->pSettings[i].Key,
|
||||||
|
pRdpSettings->pSettings[i].Value.s);
|
||||||
|
}
|
||||||
|
|
||||||
BytesToWrite = wcslen(line) * sizeof(WCHAR);
|
BytesToWrite = wcslen(line) * sizeof(WCHAR);
|
||||||
|
|
||||||
bRet = WriteFile(hFile,
|
bRet = WriteFile(hFile,
|
||||||
line,
|
line,
|
||||||
BytesToWrite,
|
BytesToWrite,
|
||||||
&BytesWritten,
|
&BytesWritten,
|
||||||
NULL);
|
NULL);
|
||||||
if (!bRet || BytesWritten == 0)
|
if (!bRet || BytesWritten == 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue