Git Product home page Git Product logo

win32's People

Contributors

craigberry avatar dsteinbrunner avatar jandubois avatar jmaslak avatar mbeijen avatar pbo-linaro avatar richardleach avatar rurban avatar steve-m-hay avatar tonycoz avatar xenu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

win32's Issues

Win32::IsDeveloperModeEnabled() doesn't work in 32bit Perl

From a 32bit process, Win32::IsDeveloperModeEnabled() can't see the 64bit registry key where the developer mode setting is stored. It's using a wrong (similarly named) constant to set the dwFlags argument

win32/Win32.xs

Lines 1692 to 1700 in 39daf7c

status = pfnRegGetValueA(
HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock",
"AllowDevelopmentWithoutDevLicense",
RRF_RT_REG_DWORD | KEY_WOW64_64KEY,
NULL,
&val,
&val_size
);

KEY_WOW64_64KEY is a "Registry Access Right" constant defined in winnt.h as 0x0100 - https://docs.microsoft.com/en-us/windows/win32/sysinfo/registry-key-security-and-access-rights

The correct constant to use is RRF_SUBKEY_WOW6464KEY which is defined in winreg.h as
0x00010000 - https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-reggetvaluea#RRF_SUBKEY_WOW6464KEY

Note: The RRF_SUBKEY_WOW6464KEY constant is only defined in the Windows 10 SDK, and I'm building Perl with the 8.1 SDK, and then running that binary on Windows 10 machines.

Test failures on Win10 with PowerShell and Strawberry

Using Strawberry Perl (Portables) on Windows 10, I'm having trouble installing the latest Win32 distribution via PowerShell. Please let me know if there is any other information I can provide to help debug:

PS C:\Users\cwhitener> cpanm -v --test-only Win32
cpanm (App::cpanminus) 1.7044 on perl 5.030000 built for MSWin32-x86-multi-thread-64int
Work directory is C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\data/.cpanm/work/1584363053.9400
You have make C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\c\bin\gmake.exe
You have LWP 6.39
Falling back to Archive::Tar 2.36
Searching Win32 () on cpanmetadb ...
--> Working on Win32
Fetching http://www.cpan.org/authors/id/J/JD/JDB/Win32-0.53.tar.gz ... OK
Unpacking Win32-0.53.tar.gz
Entering Win32-0.53
Checking configure dependencies from META.yml
Running Makefile.PL
Configuring Win32-0.53 ... Checking if your kit is complete...
Looks good
Generating a gmake-style Makefile
Writing Makefile for Win32
Writing MYMETA.yml and MYMETA.json
OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.44)
Building and testing Win32-0.53 ... cp Win32.pm blib\lib\Win32.pm
Running Mkbootstrap for Win32 ()
"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "Win32.bs"
"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- Win32.bs blib\arch\auto\Win32\Win32.bs 644
"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\bin\perl.exe" "C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\lib\ExtUtils/xsubpp"  -typemap C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\lib\ExtUtils\typemap  Win32.xs > Win32.xsc
"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\bin\perl.exe" -MExtUtils::Command -e mv -- Win32.xsc Win32.c
gcc -c   -s -O2 -DWIN32 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2   -DVERSION=\"0.53\" -DXS_VERSION=\"0.53\"  "-IC:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\lib\CORE"   Win32.c
"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\bin\perl.exe" -MExtUtils::Mksymlists \
     -e "Mksymlists('NAME'=>\"Win32\", 'DLBASE' => 'Win32', 'DL_FUNCS' => {  }, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
g++.exe Win32.def -o blib\arch\auto\Win32\Win32.xs.dll -mdll -s -L"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\lib\CORE" -L"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\c\lib" Win32.o   "C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\lib\CORE\libperl530.a" -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -Wl,--enable-auto-image-base
"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 755 blib\arch\auto\Win32\Win32.xs.dll
"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- Win32.bs blib\arch\auto\Win32\Win32.bs 644
"C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/CodePage.t .................. ok
t/CreateFile.t ................ ok
t/ExpandEnvironmentStrings.t .. ok
t/GetCurrentThreadId.t ........ ok
t/GetFileVersion.t ............ skipped: Only ActivePerl seems to set the perl.exe fileversion
t/GetFolderPath.t ............. ok
t/GetFullPathName.t ........... ok
t/GetLongPathName.t ........... ok
t/GetOSName.t ................. ok
t/GetOSVersion.t .............. ok
t/GetShortPathName.t .......... 1/5 # Test 2 got: "Long Path 11684" (t/GetShortPathName.t at line 15)
#   Expected: "(?^:^\\S{1,8}(\\.\\S{1,3})?$)"
#  t/GetShortPathName.t line 15 is: ok($short, qr/^\S{1,8}(\.\S{1,3})?$/);
t/GetShortPathName.t .......... Failed 1/5 subtests
t/GuidGen.t ................... ok
t/Names.t ..................... ok
t/Unicode.t ................... # Failed test 1 in t/Unicode.t at line 43
t/Unicode.t ................... 1/12 #  t/Unicode.t line 43 is: ok(-d Win32::GetANSIPathName($dir));
# Failed test 2 in t/Unicode.t at line 47
#  t/Unicode.t line 47 is: ok(-f Win32::GetANSIPathName($file));
# Failed test 3 in t/Unicode.t at line 50
#  t/Unicode.t line 50 is: ok(opendir(my $dh, Win32::GetANSIPathName($dir)));
# Failed test 5 in t/Unicode.t at line 67
#  t/Unicode.t line 67 is: ok(Win32::SetCwd($dir));
# Test 8 got: "C:\\Users\\cwhitener\\_psperl\\_perls\\perl32w64int-5.30.0.1\\data\\.cpanm\\work\\1584363053.9400\\Win32-0.53" (t/Unicode.t at line 78)
#   Expected: "C:\\Users\\cwhitener\\_psperl\\_perls\\perl32w64int-5.30.0.1\\data\\.cpanm\\work\\1584363053.9400\\Win32-0.53\\Foo \x{394}\x{419} Bar \x{5E7}\x{645} Baz"
#  t/Unicode.t line 78 is: ok(Win32::GetLongPathName($w32dir), $long);
# Test 9 got: "C:\\Users\\cwhitener\\_psperl\\_perls\\perl32w64int-5.30.0.1\\data\\.cpanm\\work\\1584363053.9400\\Win32-0.53" (t/Unicode.t at line 86)
#   Expected: "C:\\Users\\cwhitener\\_psperl\\_perls\\perl32w64int-5.30.0.1\\data\\.cpanm\\work\\1584363053.9400\\Win32-0.53\\Foo \x{394}\x{419} Bar \x{5E7}\x{645} Baz"
#  t/Unicode.t line 86 is: ok(Win32::GetLongPathName($subdir), $long);
# Failed test 10 in t/Unicode.t at line 89
#  t/Unicode.t line 89 is: ok(chdir(Win32::GetANSIPathName($dir)));
# Test 11 got: "C:\\Users\\cwhitener\\_psperl\\_perls\\perl32w64int-5.30.0.1\\data\\.cpanm\\work\\1584363053.9400\\Win32-0.53" (t/Unicode.t at line 90)
#    Expected: "C:\\Users\\cwhitener\\_psperl\\_perls\\perl32w64int-5.30.0.1\\data\\.cpanm\\work\\1584363053.9400\\Win32-0.53\\Foo \x{394}\x{419} Bar \x{5E7}\x{645} Baz"
#  t/Unicode.t line 90 is: ok(Win32::GetLongPathName(Win32::GetCwd()), $long);
t/Unicode.t ................... Failed 9/12 subtests

Test Summary Report
-------------------
t/GetShortPathName.t        (Wstat: 0 Tests: 5 Failed: 1)
  Failed test:  2
t/Unicode.t                 (Wstat: 0 Tests: 11 Failed: 8)
  Failed tests:  1-3, 5, 8-11
  Parse errors: Bad plan.  You planned 12 tests but ran 11.
Files=14, Tests=638,  3 wallclock secs ( 0.06 usr +  0.05 sys =  0.11 CPU)
Result: FAIL
Failed 2/14 test programs. 9/638 subtests failed.
gmake: *** [Makefile:958: test_dynamic] Error 255
FAIL
! Testing Win32 failed. See C:\Users\cwhitener\_psperl\_perls\perl32w64int-5.30.0.1\data\.cpanm\work\1584363053.9400\build.log for details. Retry with --force to force install it.
PS C:\Users\cwhitener>

Failure noticed on Perl5 test suite cygwin

Win32/t/Unicode is currently failing on blead

Can be noticed here for example:
https://github.com/Perl/perl5/runs/4857064214?check_suite_focus=true

cpan/Win32/t/CodePage ............................................ ok
2707
cpan/Win32/t/CreateFile .......................................... ok
2708
cpan/Win32/t/ExpandEnvironmentStrings ............................ ok
2709
cpan/Win32/t/GetCurrentThreadId .................................. ok
2710
cpan/Win32/t/GetFileVersion ...................................... skipped
2711
cpan/Win32/t/GetFolderPath ....................................... ok
2712
cpan/Win32/t/GetFullPathName ..................................... ok
2713
cpan/Win32/t/GetLongPathName ..................................... ok
2714
cpan/Win32/t/GetOSName ........................................... ok
2715
cpan/Win32/t/GetOSVersion ........................................ ok
2716
cpan/Win32/t/GetShortPathName .................................... ok
2717
cpan/Win32/t/GuidGen ............................................. ok
2718
cpan/Win32/t/Names ............................................... ok
2719
cpan/Win32/t/Privileges .......................................... ok
2720
# Test 10 got: <UNDEF> (t/Unicode.t at line 93)
2721
#    Expected: "D:\\a\\perl5\\perl5\\cygwin\\home\\runneradmin\\work\\cpan\\Win32\\Foo \x{394}\x{419} Bar \x{5E7}\x{645} Baz"
2722
#  t/Unicode.t line 93 is: ok(Win32::GetLongPathName($subdir), $long);
2723
cpan/Win32/t/Unicode ............................................. FAILED at test 10
2724
cpan/Win32API-File/t/file ........................................ ok
2725
cpan/Win32API-File/t/tie ......................................... ok

September PR Challenge

I was assigned Win32 as my September module for the PR Challenge.

I was wondering if you had anything that jumps to mind as a project for my PR. If not, I'll do some poking around to see what I can find.

GetOSName should support Windows 10, 2012

Any ideas when we should see full support for Windows 10 and 2012 Server for GetOSName ?

We are developing using ActiveState 5.20.2 and PDK 9.4 and I did upgrade the perl modules but still some people are complaining that hdwrec cannot report correctly on Windows OS name and release version.

I see from changelog, that the support is not entirely implemented. Is this correct ?

0.52 [2015-08-19]

  • minimal Windows 10 support (thanks to Joel Maslak) [PR/8]
  • refactor Windows 10 support to include ProductInfo flags
  • add tests for Windows 8.1, 10, and 2012 R2 server
  • define additional ProductInfo flags (TODO: add support for
    these codes in _GetOSName)

Win32 t/Unicode.t final test failing on cygwin

This seems similar to https://rt.cpan.org/Ticket/Display.html?id=103984

Since upgrading to cygwin 3.3.1 the perl CI has been failing this test:

$ ./perl harness -v ../cpan/Win32/t/Unicode.t
../cpan/Win32/t/Unicode.t ..
1..12
# Running under perl version 5.035006 for cygwin
# Current time local: Mon Dec  6 14:49:30 2021
# Current time GMT:   Mon Dec  6 03:49:30 2021
# Using Test.pm version 1.31
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
# Test 10 got: <UNDEF> (t/Unicode.t at line 93)
not ok 10
#    Expected: "C:\\cygwin64\\home\\Tony\\dev\\perl\\git\\perl\\cpan\\Win32\\Foo \x{394}\x{419} Bar \x{5E7}\x{645} Baz"
#  t/Unicode.t line 93 is: ok(Win32::GetLongPathName($subdir), $long);
ok 11
ok 12
Failed 1/12 subtests

Test Summary Report
-------------------
../cpan/Win32/t/Unicode.t (Wstat: 0 Tests: 12 Failed: 1)
  Failed test:  10
Files=1, Tests=12,  0 wallclock secs ( 0.00 usr  0.02 sys +  0.05 cusr  0.06 csys =  0.12 CPU)
Result: FAIL

The underlying cause appears to be:

# cwd() also returns a usable ANSI directory name
my $subdir = cwd();

not behaving as the comment appears to expect, the name returned is the UTF-8 version of the wide character name, not the ANSI name.

While this was apparently triggered by a change in Cygwin, the behaviour in Cygwin itself here seems reasonable - returning the UTF-8 version of the path (just as Linux might when the system is using a UTF-8 locale and the user creates Unicode names).

See Perl/perl5#19239 for the perl tracking issue.

0.53 release to CPAN is missing Windows 10 version logic intended for that release

The changelog for 0.53 mentions functionality added to Win32.pm and t\GetOSName.t in master, but those changes were actually not included in the 0.53 release that's on CPAN (at least, not as shown at https://metacpan.org/release/Win32/source/Win32.pm).

0.53    [2019-08-05]
        - improve Win32::GetOSDisplayName
        - added Win2016/2019 detection and version information by
          Richard Leach [PR/15]
        - Include wchar.h to allow building with g++ by Tony Cook [rt#127836]

e.g. In Win32.pm, the version handling branch just has the following for Win10:

        elsif ($major == 10) {
            $os = '10';
        }

rather than the detection mentioned in the changelog.
Similarly, the @win10_tests are missing from t\GetOSName.t at https://metacpan.org/source/JDB/Win32-0.53/t/GetOSName.t

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.