Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions
nsOERegUtil Class Reference

#include <nsOERegUtil.h>

List of all members.

Static Public Member Functions

static BYTEGetValueBytes (HKEY hKey, const char *pValueName)
static void FreeValueBytes (BYTE *pBytes)

Detailed Description

Definition at line 43 of file nsOERegUtil.h.

Member Function Documentation

void nsOERegUtil::FreeValueBytes ( BYTE pBytes) [static]

Definition at line 80 of file nsOERegUtil.cpp.

       if (pBytes)
              delete [] pBytes;

Here is the caller graph for this function:

BYTE * nsOERegUtil::GetValueBytes ( HKEY  hKey,
const char *  pValueName 
) [static]

Definition at line 41 of file nsOERegUtil.cpp.

       LONG   err;
       DWORD  bufSz;
       LPBYTE pBytes = NULL;
       DWORD  type = 0;

       err = ::RegQueryValueEx( hKey, pValueName, NULL, &type, NULL, &bufSz); 
       if (err == ERROR_SUCCESS) {
              pBytes = new BYTE[bufSz];
              err = ::RegQueryValueEx( hKey, pValueName, NULL, NULL, pBytes, &bufSz);
              if (err != ERROR_SUCCESS) {
                     delete [] pBytes;
                     pBytes = NULL;
              else {
                     if (type == REG_EXPAND_SZ) {
                            DWORD sz = bufSz;
                            LPBYTE pExpand = NULL;
                            DWORD  rSz;
                            do {
                                   if (pExpand)
                                          delete [] pExpand;
                                   sz += 1024;
                                   pExpand = new BYTE[sz];
                                   rSz = ::ExpandEnvironmentStrings( (LPCSTR) pBytes, (LPSTR) pExpand, sz);
                            } while (rSz > sz);

                            delete [] pBytes;

                            return( pExpand);

       return( pBytes);

Here is the caller graph for this function:

The documentation for this class was generated from the following files: