locked
"The data area passed to a system call is too small." With window.location.href and a custom URL protocol. RRS feed

  • Question

  • Hello,

    I have created a URL Protocol (cfrmisplugin://) as directed by MSDN which points to an application on my local machine.  See this article here: http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85)

    I am then building a URL which I then navigate to using JavaScript.  Essentially the URL contains information to be passed to the client application (URL handler) which is then processed and in turn launches Microsoft Word.  The code below demonstrates my URL building function (using ExtJS) and then calling window.location.href to carry out the launching:

    launchLetter: function (LC, ST, SF, TK, UH, TA) {
            var loca = Ext.urlEncode({
                AC: 'LETT',
                LC: LC,
                CS: txtCS.getValue(),
                ST: ST,
                SF: SF,
                TK: TK,
                LW: txtLW.getValue(),
                HP: txtHP.getValue(),
                LH: txtLH.getValue(),
                LP: txtLP.getValue(),
                UH: Ext.value(UH, false),
                TA: Ext.value(TA, '')
            }, 'CFRMISPlugin:IE=' + (Ext.isIE ? 'true' : 'false')
            );
    
            window.location.href = loca;
        }

    This produces a URL as shown below:

    CFRMISPlugin:IE=false&AC=LETT&LC=NOREP&CS=mfY%2BZS9dEp6s5XX7kdaAjZKLKQUYYGZE5JqlE6jk86jxtp9s8iFt%2F16cS0SXS8hMGr5mluHTC6BJq3mT7o8UxOHdA2eLCp%2Bj2QiVekB%2FSsVwDSS11PyjYMkNWfNFGfOV%2BJrL%2Fe01W4uLPZyfs6B3yn6DX6BupOWpdGwibpV3%2FTjG4zxiV%2BRxRIdlVmT9XVrS&ST=PREMISE%20X%2C%20premise%20p%20inner%20join%20(select%20premid%20from%20miscvisit%20m%20inner%20join%20ra_responseheader%20rh%20on%20m.jobno%20%3D%20rh.jobno%20where%20rh.model%20%3D%20'i'%20and%20m.compdate%20%3E%3D%20'01%2FAPR%2F2011'%20group%20by%20premid%20having%20count(*)%20%3E%3D%203)%20d3orMore%20%20on%20%20d3orMore.premid%20%3D%20p.premid&SF=x.premid%3Dp.premid%20AND%20P.%20Metarea%20%3D%20%40rpt_District%20and%20P.STATION%20%3D%20%40rpt_Station%20and%20NOT%20EXISTS%20(SELECT%201%20FROM%20MISCVISIT%20M%20INNER%20JOIN%20RA_RESPONSEHEADER%20RH%20ON%20M.JOBNO%20%3D%20RH.JOBNO%20AND%20M.PREMID%20%3D%20P.PREMID%20AND%20RH.MODEL%20%3D%20'D')%20and%20not%20exists%20(select%201%20from%20letterhist%20l%20where%20l.premid%20%3D%20p.premid%20and%20l.summary%20like%20'%25HFSC%20No%20Replies%20Letter%25'%20and%20l.sentdate%20%3E%3D%20'01%2Fapr%2F2011')%20&TK=PREMID&LW=false&HP=false&LH=true&LP=true&UH=true&TA=X

    Now, the URL above is 1174 characters long and produces the following error on the window.location.href line:

    SCRIPT122: The data area passed to a system call is too small.

    If I use a shorter URL then the call appears to work fine.  The only information I can find relating to the length of usable URLs is 2083 characters, referencing:

    http://stackoverflow.com/questions/812925/what-is-the-maximum-possible-length-of-a-query-string

    and interestingly the Win32Exception detailed on this page:

    http://msdn.microsoft.com/en-us/library/0w4h05yb(v=vs.90).aspx

    I see a lot of information relating to this error on the Internet but never a solution.  I have disabled Script Debugging and the likes within Internet Explorer as suggested by some but this has no effect.  I am clearly reaching a limit with a component somewhere but don't know why.  I have also tested with a URL that is 'cfrmisplugin://AAAAAAAAAA.....' to see if it was a specific character in my URL but this is not the case.  I have worked out that it falls over when the character length is around 512.

    Any help would be much appreciated.


    • Edited by PsyVision Monday, May 14, 2012 3:44 PM
    Monday, May 14, 2012 3:12 PM

Answers

All replies

  • http://

    https://

    res://

    CFRMISPlugin:

    missing //

    the extjs forum is here http://www.sencha.com/forum/


    Rob^_^

    Tuesday, May 15, 2012 8:35 AM
  • Hi IECUSTOMIZER,

    I have tried that previously with little success, I will carry out some further tests with slashes now.  Interestingly I found the following article which suggests a limit around where I am finding it!

    http://stackoverflow.com/questions/9017734/what-is-the-maximum-length-of-a-custom-url-protocol-using-synchronous-pluggable

    Tuesday, May 15, 2012 8:40 AM
  • the stackoverflow answer sounds reasonable.

    the query part of a uri must start with a ? also...


    Rob^_^

    Tuesday, May 15, 2012 10:06 AM
  • The link below details URL monikers:

    http://msdn.microsoft.com/en-us/library/ms775149(v=vs.85).aspx

    "A URL follows the syntax described in RFC 1738, which specifies a protocol scheme followed by a scheme-specific portion (<scheme><scheme-specific portion>). For example, in the URL http://www.microsoft.com/, "http" is the scheme and "//www.microsoft.com/" is the scheme-specific portion."

    Therefore, I should be able to use (and can) cfrmisplugin:whatever_text_here_in_whatever_format  as long as my <scheme-specific porition> isn't longer than the arbitrary undefined length allowed which appears to be around 508 characters.  For my purposes I think I will have to find a different method to carry out what I want to achieve thanks to yet another poor aspect of Internet Explorer - always causing workarounds.


    Tuesday, May 15, 2012 1:31 PM