Re: How to Facilitate and Use Data Protection on DOM (WinCE 6.0)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



We don't really know WHAT the application does. When you launch it from an
Init key, the command line looks like this:

<program name from Init key> 50

That's it. No extra parameters. If a single numeric command line is not
compatible with the program's parsing of its command line, you'll likely get
an error. It's QUITE possible that the parsing of the command line for any
MFC wizard-generated application assumes that the command line is always the
name of a document to be opened...

Paul T.

"Neo" <prideray@xxxxxxxxx> wrote in message
news:4cf4c0b1-1031-41b6-b94d-a0b073e35288@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 14, 8:34 am, "Bruce Eitman [eMVP]"
<bruce.eitman.nos...@xxxxxxxxxxxxxxxxxxx> wrote:
When you start an app from the init key, it is passed the LaunchXX number.
In this case 50. The error message is coming from your application.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOGhttp://geekswithblogs.net/bruceeitman

EuroTech Inc.www.EuroTech.com

"Neo" <pride...@xxxxxxxxx> wrote in message

news:dca46686-b3f7-4efb-b101-2d061894d9ed@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 13, 8:21 pm, Neo <pride...@xxxxxxxxx> wrote:



On Jun 10, 8:23 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:

The first thing that occurs to me is that you've overlooked one or
more
Read
functions that the filter should implement. If you're sure that this
is
not
the case, the second thing that occurs to me is that the reading of an
EXE
is likely to be random access, not sequential, while the reading of a
bitmap
is likely to be sequential (of course copying the files would normally
be
sequential, too, so this isn't a perfect explanation). Perhaps you've
incorrectly managed the file position pointer in the sequential access
case
and therefore goofed up the data. Third, I'd think about the
encryption/decryption algorithm. Is it completely flexible about
grabbing a
single byte out of the middle of a stream and encrypting/decrypting
that
alone? I would think that most algorithms are OK with this, but I can
conceive of one that encrypts a block of data at a time and, if you
grab
a
byte from the middle of the block and try to decrypt that, you get the
wrong
answer.

If the bitmap is not too big, set up your filter so that you can turn
encryption on and off, while still having the filter load. In one
case,
unencrypted, dump the data that is read from the bitmap to the debug
stream
or something. In the other case, where the disk is encrypted, do the
same
after the data is decrypted. If the data matches, it's not the bitmap,
but
the EXE that's the problem and you know to change your focus. If the
data
doesn't match, you can look at your code in that area of the filter
and
see
what might be going wrong.

Paul T.

"Neo" <pride...@xxxxxxxxx> wrote in message

news:03326fa8-9728-4269-b604-bcdd1d658414@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 9, 9:07 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no
instrument no spam DOT com> wrote:

There is nothing in Windows CE that is done by "just" doing
anything.
You
have to follow the instructions, make sure that your boot registry
is
set
properly to load the driver for whatever filesystem you are going to
use
to
store the registry early in boot, etc. Of course, you also have to
make
sure that any changes to the registry that you make to set an IP
address
or
anything else are flushed to the storage device before you turn off
the
power.

Paul T.

And... In case of retaining IP address across RESETs, just enabling
the hive based registry.. is what I need to do? I mean.. is there
anything apart from it ..that needs to be done.. (just wish to
confirm!).. already read about hive based registry and working
towards
it..
thanks,
Neo

Hi..

This might seem to be .. too long a post .. but I need to describe the
scenario .. so that you all have a clear picture of the problem. I
request you to be patient.
I am facing a strange problem.. In one scenario the Encryption and
Decryption in my file system filter seems to work fine but the 2nd
scenario gives the problem.. both are closely related.. hence stating
both of them:

SCENARIO 1:

a. My File System Filter (FS filter) is APPLIED to the EmbedDisk (DOM)
for encryption and decryption (I have integrated the encryption and
decryption in these functions: MyFsd_readfile, MyFsd_writefile,
MyFsd_readfilewithseek, MyFsd_writefilewithseek. I also use LockPages
() and UnlockPages() in these functions.. before I perform any
operations on the buffer). FS filter is NOT APPLIED to Removable USB
media.

b. I have a demo MFC app (demo.exe) that displays a bitmap image
(image.bmp) on the USB stick which I copy from my PC.

c. Now, I attach the USB stick to the device. Copy demo.exe to the
'Hard Disk' (Partition of DOM).. which means it is stored in the
encrypted form on the DOM.

d. Then, I copy demo.exe from the Hard Disk back to the USB stick..
effectively decrypting it while reading and getting the original
demo.exe to be stored on USB stick.
I follow the above process for image.bmp as well.

e. Then I load a wince image that does not have File System Filter for
Hard Disk as well as the Removable USB media. Connect the USB stick to
the device and copy the decrypted demo.exe and image.bmp back to the
Hard Disk. (No encryption and decryption involved in this process)

f. Now I launch demo.exe by double clicking on it.. and it
successfully displays the image from image.bmp.

P.S. I have confirmed that the files indeed get encrypted and are
usable only after transition to the decrypted form. Which implies that
Encryption and Decryption is working fine.

SCENARIO 2:

a. Same as SCENARIO 1.
b. Same as SCENARIO 1.
c. Same as SCENARIO 1.

d. I double click the demo.exe on the Hard Disk (which is stored in
the encrypted form).. which successfully launches the demo (MFC)
application but it does not display the image from image.bmp. It
neither gives any error nor does it crash..I can see demo.exe as one
of the running processes in the task manager.

(Since, demo.exe gets launched successfully, the decryption process
while reading it from the disk before launching must be correct). Is
this the issue with file access? I mean, is it possible that my app
does not get access to the image.bmp...(although both of them are on
the same path)

What can be the issue?? When I look into the registries.. I see Cache
Filter too (cachefilt.dll) is applied to the FATFS by default.. can
that cause any issues? There is a value under CacheFilt.. which
enables LockIO operations.. can this be the issue.. this is really
making me crazy.. I hv no clue .. pls pls .. somebody get me out of
this..

thanks .. if you have been patient to read it along till here!

regards,
Neo

Thaks a lot Paul for your replies and patience.. I am now able to use
data protection in all the cases.. there were some issues in one of
the implementations of read and write file functions.

Now I'm facing a different issue. I have disabled data protection. I
am trying to launch the demo.exe (which is an MFC application,
compiled in VS2005 against the SDK for my ce image) at startup.. which
is supposed to display the image.bmp from the Hard Disk (DOM). But I
get the error "50 was not found". The entry in the .reg file is as
follows:

[HKEY_LOCAL_MACHINE\init]
"Launch50"="Startup.exe"
"Depend50"=hex:14,00, 1e,00

The entry in the project.bib file is as follows:

MODULES
Startup.exe $(_FLATRELEASEDIR)\Startup.exe NK S

If I use Launch98 and Depends98 with the same values I get error "98
was not found".. but when I don't try to launch the app at startup and
run demo.exe from Hard Disk (or USB stick) by double clicking on it..
it just runs fine...(which seems fine given I have copied the MFC DLLs
to the appropriate location)

I did find existing threads with similar error, but could not conclude
where I was going wrong.. please help me as there's something I need
to take care of while using the initkey with MFC app.. and I'm not
able to figure out what!.. I'm eagerly waiting for all the suggestion
and replies..from everyone.. I really need to fix this ASAP..

There's no call to signal started in my sample MFC app... that seems
the only probable cause to me.. can anyone pls tell me the right place
to call it..

regards,
Neo

Can anyone please help me out with this? pls I need to fix this at the
earliest...
Thanks in advance,
Neo

I have changed the application, so that it calls SignalStarted() with
the Sequence Identifier I get from Init key as the parameter. But, I
still get the error. Can ParseCommandLine() and ProcessShellCommand()
be causing any issues? Anyone who has faced this issue, please let me
know.

regards,
Neo


.



Relevant Pages

  • Re: How to Facilitate and Use Data Protection on DOM (WinCE 6.0)
    ... When you start an app from the init key, it is passed the LaunchXX number. ... encryption on and off, while still having the filter load. ... Decryption in my file system filter seems to work fine but the 2nd ... am trying to launch the demo.exe (which is an MFC application, ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Encryption/Decryption
    ... so that the findfile gets file and send it to encryption and passes on to ... > So let's say the the encryption program accepts command lines like this... ... > The decryption program would work similarly... ... > filename was included in the generated file, ...
    (microsoft.public.windowsce.app.development)
  • Re: Command Line Encrypt / Decrypt for Win32 and *nix?
    ... Cipher is the command line tool for encryption and decryption on Windows ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.platformsdk.security)
  • Re: Auto-update protocol
    ... to transfer even with a single client and no interference. ... shared secret/public key is the only way to do the encryption. ... successfully decryption is the authentication. ... you can get using a generic farm server, but TFTP does not have any ...
    (comp.arch.embedded)
  • Re: Securing data to a process principal
    ... encryption key first time for the user - and use it later). ... secret. ... I need the decryption to ... You MAY think that instead of a filter driver you can simply ...
    (microsoft.public.platformsdk.security)