~ubuntu-branches/ubuntu/vivid/gnupg2/vivid-proposed

« back to all changes in this revision

Viewing changes to jnlib/w32-reg.c

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-11-01 22:15:05 UTC
  • mfrom: (14.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20131101221505-i1zpbl1qd1a3gsvx
Tags: 2.0.22-1ubuntu1
* Merge from Debian, remaining changes:
  - Drop sh prefix from openpgp test environment as it leads to exec
  invocations of sh /bin/bash leading to syntax errors from sh.  Fixes
  FTBFS detected in Ubuntu saucy archive rebuild.
  - Add udev rules to give gpg access to some smartcard readers;
    Debian #543217.
  - debian/gnupg2.udev: udev rules to set ACLs on SCM smartcard readers.
  - Add upstart user job for gpg-agent.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
}
149
149
 
150
150
 
151
 
int
152
 
write_w32_registry_string (const char *root, const char *dir,
153
 
                           const char *name, const char *value)
154
 
{
155
 
  HKEY root_key, reg_key;
156
 
 
157
 
  if ( !(root_key = get_root_key(root) ) )
158
 
    return -1;
159
 
 
160
 
  if ( RegOpenKeyEx( root_key, dir, 0, KEY_WRITE, &reg_key )
161
 
       != ERROR_SUCCESS )
162
 
    return -1;
163
 
 
164
 
  if ( RegSetValueEx (reg_key, name, 0, REG_SZ, (BYTE *)value,
165
 
                      strlen( value ) ) != ERROR_SUCCESS )
166
 
    {
167
 
      if ( RegCreateKey( root_key, name, &reg_key ) != ERROR_SUCCESS )
168
 
        {
169
 
          RegCloseKey(reg_key);
170
 
          return -1;
171
 
        }
172
 
      if ( RegSetValueEx (reg_key, name, 0, REG_SZ, (BYTE *)value,
173
 
                          strlen( value ) ) != ERROR_SUCCESS )
174
 
        {
175
 
          RegCloseKey(reg_key);
176
 
          return -1;
177
 
        }
178
 
    }
179
 
 
180
 
  RegCloseKey (reg_key);
181
 
 
182
 
  return 0;
183
 
}
184
 
 
185
151
#endif /*HAVE_W32_SYSTEM*/