Raised This Month: $32 Target: $400
 8% 

SDKCall : Invalid Handle 0 on certain computer ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-28-2011 , 19:34   SDKCall : Invalid Handle 0 on certain computer ?
Reply With Quote #1

Hi,

I'd like to know how is it possible for two computer running with the same OS-family to have different ways to run a SDKCall...

I do have my plugin AfkBomb (http://forums.alliedmods.net/showthread.php?t=152329) having someone's to drop the bomb if he's afk.

To get this done, I need to "Prepare" a SDKCall (StartPrepSDKCall, EndPrepSDKCall & cie). I'm able to get it working on my test server (Windows Vista) :

Code:
StartPrepSDKCall(SDKCall_Player);
PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "CSWeaponDrop");
PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain);
hDropWeapon = EndPrepSDKCall();
However, for sinblaster, who is also running his server on Windows (Windows Server / mmsource-1.8.5 / sourcemod-1.3.6, which are the lastest versions), it does work. He gets the error

Code:
[SM] Native "SDKCall" reported: Invalid Handle 0 (error 4)
From my "SDKCall", which does work on my own computer. My plugin is also running on currently 16 others server at this time (@game-monitor).

That makes me ask :

1. How is this possible ?
2. Is it possible that 2 plugins conflict with each others over a SDKCall ?
3. How can a handle that works for me (meaning != 0) not work for someone else (= 0), knowing that both are Windows OS?
4. Could it be my variable used for a handle that could be written by another plugin ? (Are globals variable in a plugin share-able ?)

Any tips or hint on how to resolve that problem would be appreciated.

Thanks,

Red

-----

Oh, and BTW, it seems that I'm not the only one having this problem :

http://forums.alliedmods.net/showthr...ll#post1418565
http://forums.alliedmods.net/showthr...all#post927525

However, I don't see anything that could help in other threads...

Last edited by RedSword; 03-28-2011 at 20:22.
RedSword is offline
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 03-28-2011 , 21:19   Re: SDKCall : Invalid Handle 0 on certain computer ?
Reply With Quote #2

The signature may not be properly wildcarded or there's a plugin on the Windows server that is altering the signature.
Wazz is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 03-28-2011 , 23:02   Re: SDKCall : Invalid Handle 0 on certain computer ?
Reply With Quote #3

Just FYI CSS: DM detours that signature so it won't work if CSS: DM is running. I believe you need to wild card the first 6 bytes and make sure the signature is still unique. There is a bug report to add a native to cstrike extension for CSWeaponDrop, I've already added it it's just awaiting approval.
Dr!fter is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-28-2011 , 23:35   Re: SDKCall : Invalid Handle 0 on certain computer ?
Reply With Quote #4

Quote:
Originally Posted by Dr!fter View Post
Just FYI CSS: DM detours that signature so it won't work if CSS: DM is running. I believe you need to wild card the first 6 bytes and make sure the signature is still unique.
The first 6 bytes for Windows And/Or Linux ?

Would :

Code:
"windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x89\x8D\x2A\x2A\x2A\x2A\xC6"
"linux"	"@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
Become :

Code:
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x89\x8D\x2A\x2A\x2A\x2A\xC6"
"linux"	"@______SPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
I've no idea of the wildcard in Windows... I'm assuming its 2A since it is repeated that often (I doubt I'm right... and if so that would be disastrous =x... so many 2A)

Also, would it bug if there was 2 signatures found ? Or would a random one be taken ? Or the first one ? (So if I test and if it works once it should always works)

Quote:
Originally Posted by Dr!fter View Post
There is a bug report to add a native to cstrike extension for CSWeaponDrop, I've already added it it's just awaiting approval.
Thanks. May I know when your bug report was done so I can know if I can expect it soon ?

Thank you both for your answer.
RedSword is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-29-2011 , 05:42   Re: SDKCall : Invalid Handle 0 on certain computer ?
Reply With Quote #5

2A is the wildcard lol. I think it does bug / error / fail on finding more than 1 sig.
__________________
Silvers is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 03-29-2011 , 08:51   Re: SDKCall : Invalid Handle 0 on certain computer ?
Reply With Quote #6

Quote:
Originally Posted by Silvers View Post
2A is the wildcard lol. I think it does bug / error / fail on finding more than 1 sig.
No it hooks the first match. Which may or may not crash if called.
AtomicStryker is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 03-29-2011 , 18:11   Re: SDKCall : Invalid Handle 0 on certain computer ?
Reply With Quote #7

Quote:
Originally Posted by RedSword View Post
The first 6 bytes for Windows And/Or Linux ?

Would :

Code:
"windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x89\x8D\x2A\x2A\x2A\x2A\xC6"
"linux"	"@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
Become :

Code:
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x89\x8D\x2A\x2A\x2A\x2A\xC6"
"linux"	"@______SPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
I've no idea of the wildcard in Windows... I'm assuming its 2A since it is repeated that often (I doubt I'm right... and if so that would be disastrous =x... so many 2A)

Also, would it bug if there was 2 signatures found ? Or would a random one be taken ? Or the first one ? (So if I test and if it works once it should always works)



Thanks. May I know when your bug report was done so I can know if I can expect it soon ?

Thank you both for your answer.
https://bugs.alliedmods.net/show_bug.cgi?id=4732

Thats the bug report. Also you need to add wildcards only to the windows sig. Here is the gamedata used in the bugreport (last i tested it was fine with css:dm)

PHP Code:
            "CSWeaponDrop"
            
{
                
"library"        "server"
                "windows"        "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x89\x8D\x5C\x2A\x2A\x2A\xC6\x45\x2A\x2A\x8B\x8D\x5C\x2A\x2A\x2A\xE8"
                "linux"            "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
                "mac"            "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
            


Last edited by Dr!fter; 03-29-2011 at 22:45.
Dr!fter is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-29-2011 , 20:52   Re: SDKCall : Invalid Handle 0 on certain computer ?
Reply With Quote #8

Quote:
Originally Posted by Dr!fter View Post
https://bugs.alliedmods.net/show_bug.cgi?id=4732

Thats the bug report. Also you need to add wildcards only too the windows sig. Here is the gamedata used in the bugreport (last i tested it was fine with css:dm

PHP Code:
            "CSWeaponDrop"
            
{
                
"library"        "server"
                "windows"        "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x89\x8D\x5C\x2A\x2A\x2A\xC6\x45\x2A\x2A\x8B\x8D\x5C\x2A\x2A\x2A\xE8"
                "linux"            "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
                "mac"            "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
            

Thanks. I'll test that in my plugin =D.
RedSword is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-30-2011 , 11:03   Re: SDKCall : Invalid Handle 0 on certain computer ?
Reply With Quote #9

sinblaster still get the same error =/.

Your signature works thought ...
RedSword is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode