Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static void init_oid_info ( void   )  [static]

Definition at line 1388 of file oid.c.

Referenced by crypt_oid_init().

01389 {
01390     DWORD i;
01391 
01392     oid_init_localizednames();
01393     for (i = 0; i < sizeof(oidInfoConstructors) /
01394      sizeof(oidInfoConstructors[0]); i++)
01395     {
01396         if (!IS_INTRESOURCE(oidInfoConstructors[i].pwszName))
01397         {
01398             struct OIDInfo *info;
01399 
01400             /* The name is a static string, so just use the same pointer */
01401             info = CryptMemAlloc(sizeof(struct OIDInfo));
01402             if (info)
01403             {
01404                 memset(info, 0, sizeof(*info));
01405                 info->info.cbSize = sizeof(CRYPT_OID_INFO);
01406                 info->info.pszOID = oidInfoConstructors[i].pszOID;
01407                 info->info.pwszName = oidInfoConstructors[i].pwszName;
01408                 info->info.dwGroupId = oidInfoConstructors[i].dwGroupId;
01409                 info->info.u.Algid = oidInfoConstructors[i].Algid;
01410                 if (oidInfoConstructors[i].blob)
01411                 {
01412                     info->info.ExtraInfo.cbData =
01413                      oidInfoConstructors[i].blob->cbData;
01414                     info->info.ExtraInfo.pbData =
01415                      oidInfoConstructors[i].blob->pbData;
01416                 }
01417                 list_add_tail(&oidInfo, &info->entry);
01418             }
01419         }
01420         else
01421         {
01422             LPCWSTR stringresource;
01423             int len = LoadStringW(hInstance,
01424              (UINT_PTR)oidInfoConstructors[i].pwszName,
01425              (LPWSTR)&stringresource, 0);
01426 
01427             if (len)
01428             {
01429                 struct OIDInfo *info = CryptMemAlloc(sizeof(struct OIDInfo) +
01430                  (len + 1) * sizeof(WCHAR));
01431 
01432                 if (info)
01433                 {
01434                     memset(info, 0, sizeof(*info));
01435                     info->info.cbSize = sizeof(CRYPT_OID_INFO);
01436                     info->info.pszOID = oidInfoConstructors[i].pszOID;
01437                     info->info.pwszName = (LPWSTR)(info + 1);
01438                     info->info.dwGroupId = oidInfoConstructors[i].dwGroupId;
01439                     info->info.u.Algid = oidInfoConstructors[i].Algid;
01440                     memcpy(info + 1, stringresource, len*sizeof(WCHAR));
01441                     ((LPWSTR)(info + 1))[len] = 0;
01442                     if (oidInfoConstructors[i].blob)
01443                     {
01444                         info->info.ExtraInfo.cbData =
01445                          oidInfoConstructors[i].blob->cbData;
01446                         info->info.ExtraInfo.pbData =
01447                          oidInfoConstructors[i].blob->pbData;
01448                     }
01449                     list_add_tail(&oidInfo, &info->entry);
01450                 }
01451             }
01452         }
01453     }
01454 }


Generated on Fri Feb 10 05:27:55 2012 for ReactOS by doxygen 1.6.3

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.