in reply to odd line in windows
The likely cause is identified by
try_pl_f4a3.xs: In function 'get_proc_name': try_pl_f4a3.xs:35:1: warning: function returns address of local variab +le
Which is telling you that this:
char* get_proc_name( int processID ) { TCHAR szProcessName[MAX_PATH] = TEXT("<unknown>"); ... return szProcessName; }
Is a fundamentally flawed piece of code. You are allocating a string on the stack, and then returning a pointer to it from the function. But when the function returns, the stack is unwound and can be reused by other parts of the code.
The only surprising thing here is that you actually get something returned and it doesn't crash.
You need to correct that by allocating space on the heap using Newx() or Newxc() or Newxz(). See perlapi
That said. I wonder why you aren't using Win32::Process::Info?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: odd line in windows
by xiaoyafeng (Deacon) on Sep 07, 2011 at 09:22 UTC | |
by BrowserUk (Patriarch) on Sep 07, 2011 at 09:39 UTC | |
by Anonymous Monk on Sep 07, 2011 at 09:27 UTC | |
by syphilis (Archbishop) on Sep 07, 2011 at 15:14 UTC | |
by BrowserUk (Patriarch) on Sep 07, 2011 at 15:37 UTC | |
by syphilis (Archbishop) on Sep 07, 2011 at 16:30 UTC |