Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win32.c get_regstr_from() read error on REG_EXPAND_SZ values #1865

Closed
p5pRT opened this issue Apr 20, 2000 · 3 comments
Closed

win32.c get_regstr_from() read error on REG_EXPAND_SZ values #1865

p5pRT opened this issue Apr 20, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 20, 2000

Migrated from rt.perl.org#3131 (status was 'resolved')

Searchable as RT3131$

@p5pRT
Copy link
Author

p5pRT commented Apr 20, 2000

From John.Clayton@barclayscapital.com

This is a bug report for perl from john_clayton@​usa.net,
generated with the help of perlbug 1.26 running under perl 5.00503.

The bug is on the
  if (retval == ERROR_SUCCESS && type == REG_SZ) {

line of c​:\perl\win32\win32.c (somewhere like line 144) , which should
really read​:
  if (retval == ERROR_SUCCESS && (type == REG_SZ || type ==
REG_EXPAND_SZ)) {

This is manifested by an embedded application failing to pick up modules
becase the perlcore.dll (using -DPERL_OBJECT) does not pick up and use the
INC values.

-- code excerpt , win32.c : 130 - 160ish --

/* *svp (if non-NULL) is expected to be POK (valid allocated SvPVX(*svp)) */
static char*
get_regstr_from(HKEY hkey, const char *valuename, SV **svp)
{
  /* Retrieve a REG_SZ or REG_EXPAND_SZ from the registry */
  HKEY handle;
  DWORD type;
  const char *subkey = "Software\\Perl";
  char *str = Nullch;
  long retval;

  retval = RegOpenKeyEx(hkey, subkey, 0, KEY_READ, &handle);
  if (retval == ERROR_SUCCESS) {
  DWORD datalen;
  retval = RegQueryValueEx(handle, valuename, 0, &type, NULL,
&datalen);
  if (retval == ERROR_SUCCESS && type == REG_SZ) {
  if (!*svp)
  *svp = sv_2mortal(newSVpvn("",0));
  SvGROW(*svp, datalen);
  retval = RegQueryValueEx(handle, valuename, 0, NULL,
  (PBYTE)SvPVX(*svp), &datalen);
  if (retval == ERROR_SUCCESS) {
  str = SvPVX(*svp);
  SvCUR_set(*svp,datalen-1);
  }
  }
  RegCloseKey(handle);
  }
  return str;
}


Site configuration information for perl 5.00503​:

Summary of my perl5 (5.0 patchlevel 5 subversion 03) configuration​:
  Platform​:
  osname=MSWin32, osvers=4.0, archname=MSWin32-x86-object
  uname=''
  hint=recommended, useposix=true, d_sigaction=undef
  usethreads=undef useperlio=undef d_sfio=undef
  Compiler​:
  cc='cl.exe', optimize='-O2 -MD -DNDEBUG -TP -GX', gccversion=
  cppflags='-DWIN32'
  ccflags ='-O2 -MD -DNDEBUG -TP -GX -DWIN32 -D_CONSOLE -DNO_STRICT
-DHAVE_DES_FCRYPT -DPERL_OBJECT'
  stdchar='char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
  alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries​:
  ld='link', ldflags ='-nologo -nodefaultlib -release -machine​:x86'
  libpth="C​:\Apps\ActivePerl\lib\core" "C​:\Program Files\Mts\Lib"
  libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
PerlCRT.lib
  libc=C​:\Apps\ActivePerl\lib\CORE\PerlCRT.lib, so=dll, useshrplib=yes,
libperl=perlcore.lib
  Dynamic Linking​:
  dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
-machine​:x86'

Locally applied patches​:
  ACTIVEPERL_LOCAL_PATCHES_ENTRY


@​INC for perl 5.00503​:
  C​:/APPS/ActivePerl/lib
  c​:\Apps\ActivePerl\site\lib
  c​:\Apps\ActivePerl\site
  c​:\Apps\ActivePerl\lib
  C​:/APPS/ActivePerl/site/lib
  .


Environment for perl 5.00503​:
  HOME (unset)
  LANG=enu
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=C​:\Perl\bin;c​:\dmi\win32\bin;C​:\WINNT\system32;C​:\WINNT;C​:\Program
Files\Mts;C​:\atria\bin;C​:\Apps\ActivePerl\Bin;c​:\program
files\orbix\bin;c​:\program
files\fifes;c​:\cygnus\cygwin1\h-i5861\bin;c​:\jdk1.2.2\bin;c​:\winnt\custom\
bin;C​:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C​:\Program
Files\Microsoft Visual Studio\Common\Tools;C​:\Program Files\Microsoft Visual
Studio\VC98\Bin;C​:\APPS\SYBASE\DLL;C​:\APPS\SYBASE\BIN;C​:\APPS\sybtools\WIN32
;C​:\APPS\sybtools\ASEP;C​:\Program Files\MSSQL\BINN;C​:\Program
Files\Iris\Bin;C​:\Program Files\Fifes2\Bin;C​:\Program Files\ORANT;C​:\Program
Files\ORANT\bin
  PERL_BADLANG (unset)
  SHELL (unset)


For more information about Barclays Capital, please
visit our web site at http​://www.barcap.com.

Internet communications are not secure and therefore the Barclays Group
does not accept legal responsibility for the contents of this message.
Any views or opinions presented are solely those of the author and do
not necessarily represent those of the Barclays Group unless otherwise
specifically stated.


@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2004

From @steve-m-hay

The requestor's proposed change was applied as change #6003, first
available in a stable release as v5.6.1.

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2004

@steve-m-hay - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant