[rt.cpan.org #79840] CreateService cannot handle more than one dependencies specified

[email protected] ("http://hellosam.net/ via RT")
Newsgroups perl.libwin32
Message-ID <[email protected]>
Tue Sep 25 01:20:18 2012: Request 79840 was acted upon.
Transaction: Ticket created by http://hellosam.net/
       Queue: Win32-Daemon
     Subject: CreateService cannot handle more than one dependencies specified
   Broken in: 20110117
    Severity: Important
       Owner: Nobody
  Requestors: [email protected]
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=79840 >


Repro step:

 1. Win32::Daemon::CreateService({
       dependencies => [qw(AFD RPCSS Tcpip)], 
       ...});
 2. Check the service created, dependency settings is not correct.

To be exact, the unfolding code is wrong (same problem in 
ConfigureService also):

    for( DWORD dwIndex = 0; dwIndex < dwCount; dwIndex++ )
    {
        _tcscpy( pszBuffer, ARRAY_GET_PV( pAv, dwIndex ) );
        // _tcslen(pszBuffer) does not consider the string already in 
szDependencies
        // Prehaps more correct to say &pszBuffer[_tcslen( pszBuffer 
)+1]
        pszBuffer = &szDependencies[ _tcslen( pszBuffer ) + 1 ];
    }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.