Changing printer settings with Rundll32 - XP Embedded

G

Guest

Using the command -- rundll32 printui.dll,PrintUIEntry /Ss /n "TTP1020" /a
"c:\settings.dat" u

causes the error dialog box "Operation cannot be completed".
Notes:
-- I'm logged in as an Administrator.
-- TTP1020 is the printer name.
-- XP Embedded operating system.
-- I'm trying to save off the printer settings.

Anyone have an idea why this command does not work on my XP Embedded machine?
 
K

KM

Marshall,

The issue you are seeing is likely due a missing dependency(ies). You may want to run that command on target device through
DependencyWalker and see what's missing.
If, and probably will, something is missing you just add those components to your image and redeploy it.

Sorry for a cliche reply but you haven't mentioned anything about the print related components included in your XPe image.
 
K

KM

Marshall,

You may be missing a dynamic dependency. You can find out if you run the command line you mentioned earlier through the
DependencyWalker Profiler.

Open up printui.dll in DependencyWalker, then you will see a new Profile menu on the top. If you select Start Profile it will query
you for the command line to use.
 
G

Guest

KM - I was missing msjava.dll. Although, I'm still having the same problem.
When I profile Rundll32 with the command line ---

printui,PrintUIEntry /Ss /n "TTP1020" /a "c:\temp\settings.dat" u ---

I still get the "Operation cannot complete" error. In the dependency walker
it seems to be failing after a call to GDI32.dll -- GetTextExtentExPointWPri"
called from USP10.DLL
 
K

KM

Marshall,

DependencyWalker showing missing msjava.dll is typically a bogus message. You can safely ignore it.

Quick question, did you make sure Print Spooler service is running before you issued that command?
 
G

Guest

KM - Yes the Print Spooler service is running.


KM said:
Marshall,

DependencyWalker showing missing msjava.dll is typically a bogus message. You can safely ignore it.

Quick question, did you make sure Print Spooler service is running before you issued that command?
 
K

KM

How about monitoring the command launch with FileMon tool from www.sysinternals.com?
If a Dll is missing you'd see there are failures on loading that dll in the FileMon log.

You may certainly want to analyze the FileMon log first at the time when that call to GDI32 you mentioned you caught with
DependencyWalker is failing.

Btw, I've asked you this earlier, was it you who developed the image? Do you have a way to change the image now, I mean can you
rebuild it with some components added?
 
G

Guest

KM -I was not the original builder of the image, but I am now. I have the
machine where they created the image using Target and Component designer. I
can re-build the image...although it is not an option for this problem. The
reason is that we (Coinstar) has already deployed the current image on 12
thousand machines. Anyway...as you know I'm just trying to change an Advanced
printer setting for our Swecoin printer. What I can do is send down missing
Windows DLLs or update existing DLLs.

I will try the Filemon tool and let you know what I find.

Marshall
 
G

Guest

KM - One other thing that I have noticed through depends.exe. On my regular
XP machine Rundll32 calls printuientry, then later on Ole32 loads the
printui.dll. On my XP Embedded machine ole32.dll does not load the
printui.dll. Not sure why??

Also, regarding the comment i made about failing after gdi32 call. That was
wrong...GDI32 is not failing...it is throwing up the message box "Operation
could not complete".
 
K

KM

Marshall,

While you are trying to get more info with the FileMon, elts gather more info about your image.

Does the printer you mention work no problem on the image? Does the Local printing works on the image at all?
What components have been included in the original image to support the local printing? Was that printer driver installed there
correctly? (What Device Manager shows?)
 
G

Guest

KM - The Swecoin TTP1020 printer works/prints fine. The printing components
installed are: Client Printing Support and Local Printing Support. The driver
is installed corecctly. Just to make sure I uninstalled and
re-installed...performed a print. In the device manager under ports it shows
the print port on LPT1 and for the status it says "The device is working
properly".

Regarding Filemon - I'm not sure what other information I can get from this
application. I can send you a copy of the log file.
 
K

KM

Marshall,

Please feel free to post you FileMon log here (the best would be to attach it as a file using a mail client like Outlook Express or
etc.).
What you want to be looking for there is failures on loading some components (drivers, dlls, etc.). You may, of course, see nothing
related if the error is there not due to a missing component.

Did you check your Event log? I wonder if any error or warning appears there after you see the error.

Do you have pagefile enabled on your device? If not, please enable it at least for debugging purposes.

It is also been known that for certain operations with printers you got to have printer driver help files installed on device. So
make sure to satisfy this requirement in your image.
 
G

Guest

KM -
I will have to figure out another way to get you the FileMon log file. At my
work we are blocked such that I cannot use Outlook express.
Did you check your Event log? > Below is the Eventlog text --

Error Instrument: ProcessName: rundll32.exe WindowTitle:
C:\WINDOWS\system32\cmd.exe MsgCaption: Printers MsgText: Operation could
not be completed. CallerModuleName: unknown BaseAddr: 0XFFFFFFFF
ImageSize: 0XFFFFFFFF ReturnAddr: 0X00000001

Do you have pagefile enabled on your device? If not, please enable it at least for debugging purposes. > I'm not sure because I can't find where to enable it?? The help says to select it in Target Designer...I don't see the option/check box there??

It is also been known that for certain operations with printers you got to have printer driver help files installed on device. > The check box for the printing components "Do not copy help files for this component" was not selected when the image was created. Therefore, they should have been installed.
 
K

KM

Marshall,
KM -
I will have to figure out another way to get you the FileMon log file. At my
work we are blocked such that I cannot use Outlook express.

A web share or similar would work. Or create a new thread on www.xpefiles.com. Thanks to Brad, the new software running on that
server allows you to attach files to thread discussions.
Error Instrument: ProcessName: rundll32.exe WindowTitle:
C:\WINDOWS\system32\cmd.exe MsgCaption: Printers MsgText: Operation could
not be completed. CallerModuleName: unknown BaseAddr: 0XFFFFFFFF
ImageSize: 0XFFFFFFFF ReturnAddr: 0X00000001

Very "informative", typical for XPe :)
What's the Event ID mentioned in the log?

Hmm.. In TD you would change that under HAL component settings (Standard PC, ACPI PC, etc.)
At run time you should go to System COntrol Panel applet and on Advanced page click Performance and then Advanced tab again, Virtual
Memory section. Otherwise just enable and set it up via registry settings (Session Manager)

Well, anothe importnat settings you should check is "Do not copy help files for this configuration" on the settings on your
Configuration loaded in TD. This option is usually ON by default.

KM
 
G

Guest

KM - The Event code is 1072.

I will try to upload the FileMon log file tomorrow at on the XPEFiles.com
site. One question -- How? I did not see anything on the post page that will
enable me to upload a file.
 
K

KM

Marshall,

To post on the XPe forum page you need to log in with a registered name.
On the post page you will see an Attachment section.
 
G

Guest

KM - I posted it in the Software/Applications forum. The Forum where I
thought it should go does not allow attachments.
 
K

KM

Marshall,

Interesting.. XPe Forum on xpefiles.com allowed me to attach files without problem.
Anyway, I checked your FileMon log. I agree, not much info there. I can see where exactly the problem occurred (place where it
logged the event to Event log) but nothing suspicious is around that call that could lead us to the source of the problem.
Btw, you can attach FBAlog.txt to the same thread there. Maybe some relevant info is there.

It would be helpful if you could capture the same log on working XP Pro machine.
It also may help you to find the right reason if you analyze Regmon logs the same way.

I am getting out of ideas on how to easy debug the issue.
Last resorts may be:
- try to repro the issue on XPProEmulation image (www.xpefiles.com) on FP2007. Who knows maybe the issue was already fixed
and/or it is not a matter of missing component at all.
- connect WinDbg from another machine to your system, replace a few system Dlls by checked versions (e.g., GDI32, printui,
USP10, etc.) and try to see what error message they are spitting out to a serial port. Or even go through a call stack at the moment
when the issue occurs. Really laborious approach, though.
 
G

Guest

KM - Thanks for your help. I decided to just write a script that will set the
setting for me. It's not as clean as the other solution...but it works.

Thanks again.

Marshall
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top