From: Steve Hay Date: Fri, 27 Jun 2008 14:39:33 +0000 (+0000) Subject: Upgrade to Win32-0.37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=280cf07eab629d0d4801176eedac7fefa4afecc7;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Win32-0.37 p4raw-id: //depot/perl@34090 --- diff --git a/ext/Win32/Changes b/ext/Win32/Changes index b8f936c..1f80899 100644 --- a/ext/Win32/Changes +++ b/ext/Win32/Changes @@ -1,5 +1,8 @@ Revision history for the Perl extension Win32. +0.37 [2008-06-26] + - Add Win32::GetCurrentProcessId() function + 0.36 [2008-04-17] - Add typecasts for Win64 compilation diff --git a/ext/Win32/Win32.pm b/ext/Win32/Win32.pm index 89ec732..b032d99 100644 --- a/ext/Win32/Win32.pm +++ b/ext/Win32/Win32.pm @@ -8,7 +8,7 @@ BEGIN { require DynaLoader; @ISA = qw|Exporter DynaLoader|; - $VERSION = '0.36'; + $VERSION = '0.37'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -403,15 +403,25 @@ If supported by the core Perl version, this function will return an ANSI path name for the current directory if the long pathname cannot be represented in the system codepage. +=item Win32::GetCurrentProcessId() + +Returns the process identifier of the current process. Until the +process terminates, the process identifier uniquely identifies the +process throughout the system. + +The current process identifier is normally also available via the +predefined $$ variable. Under fork() emulation however $$ may contain +a pseudo-process identifier that is only meaningful to the Perl +kill(), wait() and waitpid() functions. The +Win32::GetCurrentProcessId() function will always return the regular +Windows process id, even when called from inside a pseudo-process. + =item Win32::GetCurrentThreadId() Returns the thread identifier of the calling thread. Until the thread terminates, the thread identifier uniquely identifies the thread throughout the system. -Note: the current process identifier is available via the predefined -$$ variable. - =item Win32::GetFileVersion(FILENAME) Returns the file version number from the VERSIONINFO resource of diff --git a/ext/Win32/Win32.xs b/ext/Win32/Win32.xs index 05ab602..ae2bad2 100644 --- a/ext/Win32/Win32.xs +++ b/ext/Win32/Win32.xs @@ -1590,6 +1590,13 @@ XS(w32_OutputDebugString) XSRETURN_EMPTY; } +XS(w32_GetCurrentProcessId) +{ + dXSARGS; + EXTEND(SP,1); + XSRETURN_IV(GetCurrentProcessId()); +} + XS(w32_GetCurrentThreadId) { dXSARGS; @@ -1701,6 +1708,7 @@ BOOT: newXS("Win32::CopyFile", w32_CopyFile, file); newXS("Win32::Sleep", w32_Sleep, file); newXS("Win32::OutputDebugString", w32_OutputDebugString, file); + newXS("Win32::GetCurrentProcessId", w32_GetCurrentProcessId, file); newXS("Win32::GetCurrentThreadId", w32_GetCurrentThreadId, file); newXS("Win32::CreateDirectory", w32_CreateDirectory, file); newXS("Win32::CreateFile", w32_CreateFile, file);