Azaret / superputty

Automatically exported from code.google.com/p/superputty
MIT License
0 stars 0 forks source link

PInvokeStackInbalance was detected - in C# Dev environment. #124

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use SVN code an opening in VS2010 (mines Ultimate)
2. open a putty session or close a session
3. Big notice will appear for code below

_______________________________
A call to PInvoke function 
'SuperPutty!SuperPutty.Utils.NativeMethods::SetWindowLong' has unbalanced the 
stack. This is likely because the managed PInvoke signature does not match the 
unmanaged target signature. Check that the calling convention and parameters of 
the PInvoke signature match the target unmanaged signature.
__________________________________

occurs in section :

ctlApplicationPanel.cs
        protected override void OnVisibleChanged(EventArgs e)
.
.
.
                // set window parameters (how it's displayed)
                long lStyle = NativeMethods.GetWindowLong(m_AppWin, NativeMethods.GWL_STYLE);
                lStyle &= ~(NativeMethods.WS_BORDER | NativeMethods.WS_THICKFRAME);
                NativeMethods.SetWindowLong(m_AppWin, NativeMethods.GWL_STYLE, lStyle);  #<---- OCCURS HERE.
            }

What is the expected output? What do you see instead?
Warning of unstable stack should not really occur

What version of the product are you using? On what operating system?
SVN 1.2.0.9 (well that's what about shows)

Please provide any additional information below.

Possibly explains why on some machines, putty is not attached to S.P. and 
simply pops up in it's own window. Works fine if I force F5 continue but 
unstable stack warning worth a mention as I don't know how bad this actually 
is. not a WinAPI Hooks man for many years now, especially C#.

Original issue reported on code.google.com by djtrem...@gmail.com on 3 Jun 2012 at 2:09

GoogleCodeExporter commented 9 years ago
actually,that only controls the removal or binding to the inner window and not 
putty being embedded directly.. so last line in last comment not really the 
possible cause.

Original comment by djtrem...@gmail.com on 3 Jun 2012 at 2:11

GoogleCodeExporter commented 9 years ago
looks like our pinvoke signature for SetWindowLong has an issue.

I don't get that warning on my desktop...if you could find out the signature 
that works for on your machine, i can try it on mine.  

Original comment by btatey...@gmail.com on 9 Jun 2012 at 1:04

GoogleCodeExporter commented 9 years ago
I'm not great at winapi. I've noticed when I got an update from SVN and patched 
up my icon editing patches that it works without that error now. little 
strange. I also noticed that the binary I created taking to my friends PC which 
had an issue where Putty would open outside of SP as if it was open 
independently of SP now works fine too. Not sure if it's related but both seem 
fixed at this point so I'll monitor it for now. 

Original comment by djtrem...@gmail.com on 9 Jun 2012 at 10:56

GoogleCodeExporter commented 9 years ago
Are you using a 32-bit machine?

Original comment by roblow...@gmail.com on 15 Jun 2012 at 1:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
64bit

Original comment by djtrem...@gmail.com on 15 Jun 2012 at 10:43

GoogleCodeExporter commented 9 years ago
Found fix...will merge in changes later...

https://github.com/akngo/superputty/commit/fe626071b0e731f70f2397add6abfc2e9fb80
c76

Original comment by btatey...@gmail.com on 26 Aug 2012 at 8:25

GoogleCodeExporter commented 9 years ago

Original comment by jimradford@gmail.com on 20 Jun 2014 at 4:22