Author: gedmurphy
Date: Wed Nov 7 03:10:24 2007
New Revision: 30235
URL:
http://svn.reactos.org/svn/reactos?rev=30235&view=rev
Log:
only write out key/values in the lpSettings struct
Modified:
trunk/reactos/base/applications/mstsc/rdpfile.c
Modified: trunk/reactos/base/applications/mstsc/rdpfile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/rd…
==============================================================================
--- trunk/reactos/base/applications/mstsc/rdpfile.c (original)
+++ trunk/reactos/base/applications/mstsc/rdpfile.c Wed Nov 7 03:10:24 2007
@@ -79,32 +79,39 @@
WCHAR line[MAXKEY + MAXVALUE + 4];
DWORD BytesToWrite, BytesWritten;
BOOL bRet;
- INT i;
+ INT i, k;
for (i = 0; i < pRdpSettings->NumSettings; i++)
{
- if (pRdpSettings->pSettings[i].Type == L'i')
- {
- _snwprintf(line, MAXKEY + MAXVALUE + 4, L"%s:i:%d\r\n",
- pRdpSettings->pSettings[i].Key,
- pRdpSettings->pSettings[i].Value.i);
- }
- 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);
-
- bRet = WriteFile(hFile,
- line,
- BytesToWrite,
- &BytesWritten,
- NULL);
- if (!bRet || BytesWritten == 0)
- return FALSE;
+ /* only write out values in the lpSettings struct */
+ for (k = 0; k < NUM_SETTINGS; k++)
+ {
+ if (wcscmp(lpSettings[k], pRdpSettings->pSettings[i].Key) == 0)
+ {
+ if (pRdpSettings->pSettings[i].Type == L'i')
+ {
+ _snwprintf(line, MAXKEY + MAXVALUE + 4, L"%s:i:%d\r\n",
+ pRdpSettings->pSettings[i].Key,
+ pRdpSettings->pSettings[i].Value.i);
+ }
+ 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);
+
+ bRet = WriteFile(hFile,
+ line,
+ BytesToWrite,
+ &BytesWritten,
+ NULL);
+ if (!bRet || BytesWritten == 0)
+ return FALSE;
+ }
+ }
}
return TRUE;