Comments (6)
Are you using Winfile 10.2.0.0?
How did you determine that the args were garbled? Printing the args from MyProgram.exe?
If I debug Winfile the args 'leave' winfile via ShellExecute() in shape.
Are you sure the problem is not in MyProgram.exe when printing the args?
As far as I remember command lines are limited to 255 characters, but I could be wrong.
from winfile.
@ScottHollows I'd second schinagl's question - which release are you using? Also, which version of Windows?
I think the limitation is in RunDlgProc
. Prior to #340 , this was limited to 260 chars (total.) In the latest release this should be over 1000.
Unfortunately that doesn't explain:
- How the text is entered, because the control's width is limited to the buffer width via
EM_LIMITTEXT
- Garbled characters, which smells like a buffer overflow. Here the code is using
lstrcpy
into stack based buffers, but it "knows" that if all the text fit into the original buffer, substrings have to fit into component buffers. Also,GetDlgItemText
is documented to NULL terminate on truncate.
Originally the code used a different constant for the parameter buffer length compared to the total buffer length, which seems unsafe, but as far as I can tell in this repo they always had the same value. If there was a build where RUN_LENGTH < MAXPATHLEN
, this could happen.
from winfile.
@malxau : I hooked up with the debugger, then exactly entered the string specified by @ScottHollows, and was able see that it was fed into ShellExecute() exactly the right way.
So @ScottHollows please check MyProgramm.exe if it handles args properly
from winfile.
I wrote a test program that shows the parameters passed in to it and the length of the parameters
It runs ok from a DOS command line with 5000 characters
It also runs ok when called from a DOS batch program with 5000 characters
When I run it from File Manager > File Run it gets truncated around 1000 characters, with a bit of wiggle room that is probably the length of the program name
I have identified at least one issue where the File Run > Command Line field is limited to 1000 characters so there is no way to test parameters longer than that That 1000 limit is longer than the original 255 that I reported in my original post so must have done that test incorrectly - sorry about that. At a guess, I probably ran an older version of File Manager or I was running it in an virtual machine with an old version of Windows
When I run that same test now in Windows 10 (22H2) it correctly shows all 255 char
So, my original post was incorrect and the limit is around 1000 rather than the 255 that I reported
Since this is under review, can the limit for that Command Line field be increased to maybe 5000 characters ?
from winfile.
With #340 the length of path and all internal strings was increased to 1024.
#340 is part of 10.2.0.0
Thus the arguments of a command passed to File/Run can be 1024 characters.
I suggest to use .bat files for arguments longer than 1024 characters, because handling of so many characters in this tiny File/Run box is error prone.
from winfile.
Thanks for looking into this.
I am closing this issue now
from winfile.
Related Issues (20)
- Open Explorer.exe in selected directory HOT 5
- oomkilled HOT 1
- Question: How does non-OLE Drag and Drop work? HOT 2
- software and add-ons to edit and compile File Manager HOT 2
- Enhancement Request - Increase / Decrease Font using Ctrl + Mouse Wheel and / or new Toolbar Buttons HOT 6
- winfile do not work on windows pe 10 HOT 5
- Add create file option in context menu and toolbar HOT 3
- ζΊδΈιη HOT 2
- Folder is locked when expand the folder in left hand side HOT 2
- Read-only attribute on files copied from CD-ROM HOT 4
- Support sparse files? HOT 2
- How to specify the destination HOT 1
- I am off HOT 1
- Open File Manager starting in current folder, or folder specified on command line HOT 1
- Update Winfile on Chocolatey HOT 2
- UNC support
- Wanted: Undelete DLL
- Some saved settings are not respected when an initial directory is specified in the command line
- Control-drive letter? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winfile.