~ubuntu-branches/ubuntu/oneiric/likewise-open/oneiric

« back to all changes in this revision

Viewing changes to lwreg/shellutil/import.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Salley
  • Date: 2010-11-22 12:06:00 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122120600-8lba1fpceot71wlb
Tags: 6.0.0.53010-1
Likewise Open 6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 *          Adam Bernstein (abernstein@likewise.com)
43
43
 *
44
44
 */
45
 
#include "rsutils.h"
46
 
#include <../parse/includes.h>
47
 
#include <regclient.h>
48
 
#include <reg/lwreg.h>
 
45
#include "includes.h"
49
46
 
50
47
 
51
48
static
134
131
        }
135
132
 
136
133
        hCurrKey = pNewKey;
 
134
        pNewKey = NULL;
137
135
 
138
136
        pszKeyToken = strtok_r (NULL, pszDelim, &pszStrTokSav);
139
137
    }
188
186
    DWORD cbData = 0;
189
187
    DWORD dwDataType = 0;
190
188
    BOOLEAN bSetValue = TRUE;
 
189
    PWSTR pwszValueName = NULL;
191
190
 
192
191
    BAIL_ON_INVALID_HANDLE(hReg);
193
192
 
281
280
 
282
281
    if (bSetValue)
283
282
    {
284
 
        dwError = RegSetValueExA(
285
 
            hReg,
286
 
            hKey,
287
 
            pItem->valueName,
288
 
            0,
289
 
            pItem->type,
290
 
            pData,
291
 
            cbData);
 
283
        if (pItem->type == REG_MULTI_SZ)
 
284
        {
 
285
            dwError = RegWC16StringAllocateFromCString(
 
286
                          &pwszValueName,
 
287
                          pItem->valueName);
 
288
            BAIL_ON_REG_ERROR(dwError);
 
289
 
 
290
            dwError = RegSetValueExW(
 
291
                          hReg,
 
292
                          hKey,
 
293
                          pwszValueName,
 
294
                          0,
 
295
                          pItem->type,
 
296
                          pData,
 
297
                          cbData);
 
298
        }
 
299
        else
 
300
        {
 
301
            dwError = RegSetValueExA(
 
302
                          hReg,
 
303
                          hKey,
 
304
                          pItem->valueName,
 
305
                          0,
 
306
                          pItem->type,
 
307
                          pData,
 
308
                          cbData);
 
309
        }
292
310
        BAIL_ON_REG_ERROR(dwError);
293
311
    }
294
312
 
297
315
    LWREG_SAFE_FREE_MEMORY(pSubKey);
298
316
    LWREG_SAFE_FREE_STRING(pszKeyName);
299
317
    LWREG_SAFE_FREE_MEMORY(pData);
 
318
    LWREG_SAFE_FREE_MEMORY(pwszValueName);
300
319
 
301
320
    if (hSubKey)
302
321
    {