Discussion:
CeRapiInvoke in librapi2-0.13
David Eriksson
2009-06-22 20:10:00 UTC
Permalink
Hey,
I have been trying to get CeRapiInvoke to work. Just using the unit
tests in the release. All I get is -2147467263 as a return result.
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still only Stream mode?
UTSL :-)

Unfortunately it has not been implemented for Windows Mobile 5 or newer
devices. Any takers on the synce-devel list?
Thanks for your time,
Rob
Best regards,

David Eriksson, http://www.divideandconquer.se/
Mark Ellis
2009-06-24 07:35:08 UTC
Permalink
Post by David Eriksson
Hey,
I have been trying to get CeRapiInvoke to work. Just using the unit
tests in the release. All I get is -2147467263 as a return result.
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still only Stream mode?
UTSL :-)
Unfortunately it has not been implemented for Windows Mobile 5 or newer
devices. Any takers on the synce-devel list?
Thanks for your time,
Rob
Best regards,
David Eriksson, http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but my time is very limited at
the moment, so I'll need three things, the dll you're using on the
device and the code you're using to call it, and the command code for
CeRapiInvoke on WM5 :) I don't have anything set up to generate the call
on Windows to capture that code, so someone will have to find it for me.

Mark
David Eriksson
2009-06-24 07:59:33 UTC
Permalink
Post by Mark Ellis
Post by David Eriksson
Hey,
I have been trying to get CeRapiInvoke to work. Just using the unit
tests in the release. All I get is -2147467263 as a return result.
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still only Stream mode?
UTSL :-)
Unfortunately it has not been implemented for Windows Mobile 5 or newer
devices. Any takers on the synce-devel list?
Thanks for your time,
Rob
Best regards,
David Eriksson, http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but my time is very limited at
the moment, so I'll need three things, the dll you're using on the
device and the code you're using to call it, and the command code for
CeRapiInvoke on WM5 :) I don't have anything set up to generate the call
on Windows to capture that code, so someone will have to find it for me.
The more I think about this, the more I suspect that the CeRapiInvoke on
WM5 is more complicated than knowing the command code and that's why the
command code is not documented in
https://synce.svn.sourceforge.net/svnroot/synce/trunk/librapi2/src/rapi2/README.

I would need a few reverse engineering hours to confirm this though...


Cheers,

David, http://www.divideandconquer.se/
David Richardson
2009-06-24 22:39:47 UTC
Permalink
Post by Mark Ellis
Post by David Eriksson
Hey,
I have been trying to get CeRapiInvoke to work. Just using the unit
tests in the release. All I get is -2147467263 as a return result.
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still only Stream mode?
UTSL :-)
Unfortunately it has not been implemented for Windows Mobile 5 or newer
devices. Any takers on the synce-devel list?
Thanks for your time,
Rob
Best regards,
David Eriksson, http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but my time is very limited at
the moment, so I'll need three things, the dll you're using on the
device and the code you're using to call it, and the command code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to execute the test located at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/which
has a DLL with it.

If someone can briefly explain how I would go about getting the command code
for CeRapiInvoke on WM5, I have the necessary hardware and time.
Post by Mark Ellis
I don't have anything set up to generate the call
on Windows to capture that code, so someone will have to find it for me.
Mark
------------------------------------------------------------------------------
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
Captain Fourier
2009-06-25 01:39:25 UTC
Permalink
Yes, I was referring to the dll invokeme.dll. I have also tried making
my own in Visual Studio.
Post by David Richardson
Post by Mark Ellis
Post by David Eriksson
Hey,
I have been trying to get CeRapiInvoke to work. Just using the unit
tests in the release. All I get is -2147467263 as a return result.
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still only Stream mode?
UTSL :-)
Unfortunately it has not been implemented for Windows Mobile 5 or newer
devices. Any takers on the synce-devel list?
Thanks for your time,
Rob
Best regards,
David Eriksson, http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but my time is very limited at
the moment, so I'll need three things, the dll you're using on the
device and the code you're using to call it, and the command code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to execute the test located at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/which
has a DLL with it.
If someone can briefly explain how I would go about getting the command code
for CeRapiInvoke on WM5, I have the necessary hardware and time.
Post by Mark Ellis
I don't have anything set up to generate the call
on Windows to capture that code, so someone will have to find it for me.
Mark
------------------------------------------------------------------------------
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
Mark Ellis
2009-06-25 10:44:51 UTC
Permalink
Post by David Eriksson
Hey,
I have been trying to get CeRapiInvoke to work. Just using
the unit
Post by David Eriksson
tests in the release. All I get is -2147467263 as a return
result.
Post by David Eriksson
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still only Stream mode?
UTSL :-)
Unfortunately it has not been implemented for Windows Mobile
5 or newer
Post by David Eriksson
devices. Any takers on the synce-devel list?
Thanks for your time,
Rob
Best regards,
David Eriksson, http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but my time is very limited at
the moment, so I'll need three things, the dll you're using on the
device and the code you're using to call it, and the command code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to execute the test located at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/ which has a DLL with it.
Ah yes, I've never noticed that there !
If someone can briefly explain how I would go about getting the
command code for CeRapiInvoke on WM5, I have the necessary hardware
and time.
Theoretically, run a small program on a windows host that just
RapiInit's and calls the command we're interested in, and capture the
transmission on the network interface using eg. wireshark.

Of course, being MS it's rarely that straightforward, and if David is
correct it could be a lot more complex. However, if you could use the
test prog for CeRapiInvoke from windows and capture everything over the
interface, we might be fortunate.
I don't have anything set up to generate the call
on Windows to capture that code, so someone will have to find it for me.
Mark
------------------------------------------------------------------------------
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
David Richardson
2009-06-26 19:44:51 UTC
Permalink
I'm calling
hr = CeRapiInvoke("\\invokeme.dll", "PingBuffer", PING_BUFFER_SIZE, buffer,
&output_size, &output_buffer, NULL, 0);

with PING_BUFFER_SIZE = 10

I've attached the wireshark pcap. Ignore everything before 12 seconds. I
called the identical invoke 3 times on the device. buffer should be 10
0xDD's. output_buffer and output_size were uninitialized and when finished
output_buffer is identical to buffer and output_size is 10
(PING_BUFFER_SIZE).

I'm not sending this to hand it off to you guys. I'm still looking at this
myself to see if I can implement it or figure out the command code, but I'm
sure the people on this list have more experience doing this.

Let me know if you have any questions or want me to redo with some changes.

-David Richardson
Post by David Eriksson
Hey,
I have been trying to get CeRapiInvoke to work. Just using
the unit
Post by David Eriksson
tests in the release. All I get is -2147467263 as a return
result.
Post by David Eriksson
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still only Stream mode?
UTSL :-)
Unfortunately it has not been implemented for Windows Mobile
5 or newer
Post by David Eriksson
devices. Any takers on the synce-devel list?
Thanks for your time,
Rob
Best regards,
David Eriksson, http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but my time is very limited at
the moment, so I'll need three things, the dll you're using on the
device and the code you're using to call it, and the command code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to execute the test located at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/which has a DLL with it.
Ah yes, I've never noticed that there !
If someone can briefly explain how I would go about getting the
command code for CeRapiInvoke on WM5, I have the necessary hardware
and time.
Theoretically, run a small program on a windows host that just
RapiInit's and calls the command we're interested in, and capture the
transmission on the network interface using eg. wireshark.
Of course, being MS it's rarely that straightforward, and if David is
correct it could be a lot more complex. However, if you could use the
test prog for CeRapiInvoke from windows and capture everything over the
interface, we might be fortunate.
I don't have anything set up to generate the call
on Windows to capture that code, so someone will have to find
it for me.
Mark
------------------------------------------------------------------------------
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
David Richardson
2009-06-26 20:37:41 UTC
Permalink
I called CeCreateFile("//test.txt", GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); and watched that connection on
wireshark so I had some basis for comparison.

CeCreateFile has a command code of 0x16 and using this knowledge I believe
the command code for CeRapiInvoke is 0x4C on WM5. (Which according to
https://synce.svn.sourceforge.net/svnroot/synce/trunk/librapi2/src/rapi2/READMEis
already taken by CeSetDatabaseInfoEx which is troubling, I think)

I've attached the log of CeCreateFile in case someone wants to double check
my work or like me finds it easier to compare the two side-by-side.

My amateur opinion is that CeCreateFile and CeRapiInvoke look really similar
on the wire and is hopefully not hard to implement for that reason. I'll
try my hand at it today.
-David Richardson
Post by David Richardson
I'm calling
hr = CeRapiInvoke("\\invokeme.dll", "PingBuffer", PING_BUFFER_SIZE, buffer,
&output_size, &output_buffer, NULL, 0);
with PING_BUFFER_SIZE = 10
I've attached the wireshark pcap. Ignore everything before 12 seconds. I
called the identical invoke 3 times on the device. buffer should be 10
0xDD's. output_buffer and output_size were uninitialized and when finished
output_buffer is identical to buffer and output_size is 10
(PING_BUFFER_SIZE).
I'm not sending this to hand it off to you guys. I'm still looking at this
myself to see if I can implement it or figure out the command code, but I'm
sure the people on this list have more experience doing this.
Let me know if you have any questions or want me to redo with some changes.
-David Richardson
Post by David Eriksson
Hey,
I have been trying to get CeRapiInvoke to work. Just using
the unit
Post by David Eriksson
tests in the release. All I get is -2147467263 as a return
result.
Post by David Eriksson
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still only Stream mode?
UTSL :-)
Unfortunately it has not been implemented for Windows Mobile
5 or newer
Post by David Eriksson
devices. Any takers on the synce-devel list?
Thanks for your time,
Rob
Best regards,
David Eriksson, http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but my time is very
limited at
the moment, so I'll need three things, the dll you're using on the
device and the code you're using to call it, and the command code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to execute the test located at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/which has a DLL with it.
Ah yes, I've never noticed that there !
If someone can briefly explain how I would go about getting the
command code for CeRapiInvoke on WM5, I have the necessary hardware
and time.
Theoretically, run a small program on a windows host that just
RapiInit's and calls the command we're interested in, and capture the
transmission on the network interface using eg. wireshark.
Of course, being MS it's rarely that straightforward, and if David is
correct it could be a lot more complex. However, if you could use the
test prog for CeRapiInvoke from windows and capture everything over the
interface, we might be fortunate.
I don't have anything set up to generate the call
on Windows to capture that code, so someone will have to find
it for me.
Mark
------------------------------------------------------------------------------
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
Mark Ellis
2009-06-29 10:39:15 UTC
Permalink
Post by David Richardson
I called CeCreateFile("//test.txt", GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); and watched that
connection on wireshark so I had some basis for comparison.
CeCreateFile has a command code of 0x16 and using this knowledge I
believe the command code for CeRapiInvoke is 0x4C on WM5. (Which
according to
https://synce.svn.sourceforge.net/svnroot/synce/trunk/librapi2/src/rapi2/README is already taken by CeSetDatabaseInfoEx which is troubling, I think)
I've attached the log of CeCreateFile in case someone wants to double
check my work or like me finds it easier to compare the two
side-by-side.
My amateur opinion is that CeCreateFile and CeRapiInvoke look really
similar on the wire and is hopefully not hard to implement for that
reason. I'll try my hand at it today.
-David Richardson
On Fri, Jun 26, 2009 at 12:44 PM, David Richardson
I'm calling
hr = CeRapiInvoke("\\invokeme.dll", "PingBuffer",
PING_BUFFER_SIZE, buffer, &output_size, &output_buffer, NULL,
0);
with PING_BUFFER_SIZE = 10
David, the trace of the call sent to the device looks good. It actually
looks exactly like what rapi1 invoke would send apart from the command
code, which should make life easier.

I can't see the data being sent back however. The data returned from the
first call (packet 16) looks like this

0c 00 00 00 data len = 0x0c = 12
7e 00 00 00 error mod not found
7e 00 07 80
00 00 00 00

which would suggest it can't find the dll. Is the path correct in your
call ?

As for code 0x4c being assigned to CeSetDatabaseInfoEx, none of the
database functions for rapi2 have been implemented. Maybe David (E) can
give some indication of how reliable that list is ?

Mark
Post by David Richardson
I've attached the wireshark pcap. Ignore everything before 12
seconds. I called the identical invoke 3 times on the
device. buffer should be 10 0xDD's. output_buffer and
output_size were uninitialized and when finished output_buffer
is identical to buffer and output_size is 10
(PING_BUFFER_SIZE).
I'm not sending this to hand it off to you guys. I'm still
looking at this myself to see if I can implement it or figure
out the command code, but I'm sure the people on this list
have more experience doing this.
Let me know if you have any questions or want me to redo with some changes.
-David Richardson
On Thu, Jun 25, 2009 at 3:44 AM, Mark Ellis
On Wed, Jun 24, 2009 at 12:35 AM, Mark Ellis
On Mon, 2009-06-22 at 22:10 +0200, David
On Wed, 2009-06-17 at 18:07 -0700, Captain
Hey,
I have been trying to get CeRapiInvoke
to work. Just using
the unit
tests in the release. All I get is
-2147467263 as a return
result.
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still
only Stream mode?
UTSL :-)
Unfortunately it has not been implemented
for Windows Mobile
5 or newer
devices. Any takers on the synce-devel
list?
Thanks for your time,
Rob
Best regards,
David Eriksson,
http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but
my time is very
limited at
the moment, so I'll need three things, the
dll you're using on
the
device and the code you're using to call it,
and the command
code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to execute the test located
at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/ which has a DLL with it.
Ah yes, I've never noticed that there !
If someone can briefly explain how I would go about
getting the
command code for CeRapiInvoke on WM5, I have the
necessary hardware
and time.
Theoretically, run a small program on a windows host
that just
RapiInit's and calls the command we're interested in,
and capture the
transmission on the network interface using eg. wireshark.
Of course, being MS it's rarely that straightforward,
and if David is
correct it could be a lot more complex. However, if
you could use the
test prog for CeRapiInvoke from windows and capture
everything over the
interface, we might be fortunate.
I don't have anything set up to generate the
call
on Windows to capture that code, so someone
will have to find
it for me.
Mark
------------------------------------------------------------------------------
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
Mark Ellis
2009-06-29 14:42:48 UTC
Permalink
Post by Mark Ellis
Post by David Richardson
I called CeCreateFile("//test.txt", GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); and watched that
connection on wireshark so I had some basis for comparison.
CeCreateFile has a command code of 0x16 and using this knowledge I
believe the command code for CeRapiInvoke is 0x4C on WM5. (Which
according to
https://synce.svn.sourceforge.net/svnroot/synce/trunk/librapi2/src/rapi2/README is already taken by CeSetDatabaseInfoEx which is troubling, I think)
I've attached the log of CeCreateFile in case someone wants to double
check my work or like me finds it easier to compare the two
side-by-side.
My amateur opinion is that CeCreateFile and CeRapiInvoke look really
similar on the wire and is hopefully not hard to implement for that
reason. I'll try my hand at it today.
-David Richardson
On Fri, Jun 26, 2009 at 12:44 PM, David Richardson
I'm calling
hr = CeRapiInvoke("\\invokeme.dll", "PingBuffer",
PING_BUFFER_SIZE, buffer, &output_size, &output_buffer, NULL,
0);
with PING_BUFFER_SIZE = 10
David, the trace of the call sent to the device looks good. It actually
looks exactly like what rapi1 invoke would send apart from the command
code, which should make life easier.
I can't see the data being sent back however. The data returned from the
first call (packet 16) looks like this
0c 00 00 00 data len = 0x0c = 12
7e 00 00 00 error mod not found
7e 00 07 80
00 00 00 00
which would suggest it can't find the dll. Is the path correct in your
call ?
As for code 0x4c being assigned to CeSetDatabaseInfoEx, none of the
database functions for rapi2 have been implemented. Maybe David (E) can
give some indication of how reliable that list is ?
Mark
Sometimes I wonder why I spend so much time writing software that deals
with MS rubbish :)

Can't invoke on WM5+ because it's in 'RAPI Restricted Mode', anyone know
how to switch to 'Open Mode' ?
Post by Mark Ellis
Post by David Richardson
I've attached the wireshark pcap. Ignore everything before 12
seconds. I called the identical invoke 3 times on the
device. buffer should be 10 0xDD's. output_buffer and
output_size were uninitialized and when finished output_buffer
is identical to buffer and output_size is 10
(PING_BUFFER_SIZE).
I'm not sending this to hand it off to you guys. I'm still
looking at this myself to see if I can implement it or figure
out the command code, but I'm sure the people on this list
have more experience doing this.
Let me know if you have any questions or want me to redo with
some changes.
-David Richardson
On Thu, Jun 25, 2009 at 3:44 AM, Mark Ellis
On Thu, 2009-06-25 at 00:39 +0200, David Richardson
On Wed, Jun 24, 2009 at 12:35 AM, Mark Ellis
On Mon, 2009-06-22 at 22:10 +0200, David
On Wed, 2009-06-17 at 18:07 -0700, Captain
Hey,
I have been trying to get CeRapiInvoke
to work. Just using
the unit
tests in the release. All I get is
-2147467263 as a return
result.
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still
only Stream mode?
UTSL :-)
Unfortunately it has not been implemented
for Windows Mobile
5 or newer
devices. Any takers on the synce-devel
list?
Thanks for your time,
Rob
Best regards,
David Eriksson,
http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but
my time is very
limited at
the moment, so I'll need three things, the
dll you're using on
the
device and the code you're using to call it,
and the command
code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to execute the test located
at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/ which has a DLL with it.
Ah yes, I've never noticed that there !
If someone can briefly explain how I would go about
getting the
command code for CeRapiInvoke on WM5, I have the
necessary hardware
and time.
Theoretically, run a small program on a windows host
that just
RapiInit's and calls the command we're interested in,
and capture the
transmission on the network interface using eg.
wireshark.
Of course, being MS it's rarely that straightforward,
and if David is
correct it could be a lot more complex. However, if
you could use the
test prog for CeRapiInvoke from windows and capture
everything over the
interface, we might be fortunate.
I don't have anything set up to generate the
call
on Windows to capture that code, so someone
will have to find
it for me.
Mark
------------------------------------------------------------------------------
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
David Eriksson
2009-06-29 16:18:21 UTC
Permalink
Post by Mark Ellis
Can't invoke on WM5+ because it's in 'RAPI Restricted Mode', anyone know
how to switch to 'Open Mode' ?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/wce51conRAPIRestrictedModeSecurity.asp


Mvh,

David Eriksson, http://www.divideandconquer.se/
David Richardson
2009-06-29 18:26:01 UTC
Permalink
Post by Mark Ellis
Post by David Richardson
I called CeCreateFile("//test.txt", GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); and watched that
connection on wireshark so I had some basis for comparison.
CeCreateFile has a command code of 0x16 and using this knowledge I
believe the command code for CeRapiInvoke is 0x4C on WM5. (Which
according to
https://synce.svn.sourceforge.net/svnroot/synce/trunk/librapi2/src/rapi2/READMEis already taken by CeSetDatabaseInfoEx which is troubling, I think)
Post by Mark Ellis
Post by David Richardson
I've attached the log of CeCreateFile in case someone wants to double
check my work or like me finds it easier to compare the two
side-by-side.
My amateur opinion is that CeCreateFile and CeRapiInvoke look really
similar on the wire and is hopefully not hard to implement for that
reason. I'll try my hand at it today.
-David Richardson
On Fri, Jun 26, 2009 at 12:44 PM, David Richardson
I'm calling
hr = CeRapiInvoke("\\invokeme.dll", "PingBuffer",
PING_BUFFER_SIZE, buffer, &output_size, &output_buffer, NULL,
0);
with PING_BUFFER_SIZE = 10
David, the trace of the call sent to the device looks good. It actually
looks exactly like what rapi1 invoke would send apart from the command
code, which should make life easier.
I can't see the data being sent back however. The data returned from the
first call (packet 16) looks like this
0c 00 00 00 data len = 0x0c = 12
7e 00 00 00 error mod not found
7e 00 07 80
00 00 00 00
which would suggest it can't find the dll. Is the path correct in your
call ?
I noticed that as well. Check out this pcap file. I'm calling PingResult
this time and you can actually see the data being returned. PingResult takes
a value and returns it as a the return code. I'm passing in 0x12345678. I'm
trying to take it one step at a time and just trying to get the return code
and error code to be valid before I worry about reading the output_size and
output_buffer. I've got that working. You're right, its pretty much
exactly the same as the old invoke.

I'll implement the reading of output_size and buffer today and send a
patch. I'm not going to look into stream mode at this time, but may in the
future.

Thanks for all the help!
Post by Mark Ellis
As for code 0x4c being assigned to CeSetDatabaseInfoEx, none of the
database functions for rapi2 have been implemented. Maybe David (E) can
give some indication of how reliable that list is ?
Mark
Sometimes I wonder why I spend so much time writing software that deals
with MS rubbish :)
Can't invoke on WM5+ because it's in 'RAPI Restricted Mode', anyone know
how to switch to 'Open Mode' ?
I'm not encountering this problem. I'm guessing its because I disabled all
security in Visual Studio for the device.
Post by Mark Ellis
Post by David Richardson
I've attached the wireshark pcap. Ignore everything before 12
seconds. I called the identical invoke 3 times on the
device. buffer should be 10 0xDD's. output_buffer and
output_size were uninitialized and when finished output_buffer
is identical to buffer and output_size is 10
(PING_BUFFER_SIZE).
I'm not sending this to hand it off to you guys. I'm still
looking at this myself to see if I can implement it or figure
out the command code, but I'm sure the people on this list
have more experience doing this.
Let me know if you have any questions or want me to redo with
some changes.
-David Richardson
On Thu, Jun 25, 2009 at 3:44 AM, Mark Ellis
On Thu, 2009-06-25 at 00:39 +0200, David Richardson
On Wed, Jun 24, 2009 at 12:35 AM, Mark Ellis
On Mon, 2009-06-22 at 22:10 +0200, David
On Wed, 2009-06-17 at 18:07 -0700, Captain
Hey,
I have been trying to get CeRapiInvoke
to work. Just using
the unit
tests in the release. All I get is
-2147467263 as a return
result.
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still
only Stream mode?
UTSL :-)
Unfortunately it has not been implemented
for Windows Mobile
5 or newer
devices. Any takers on the synce-devel
list?
Thanks for your time,
Rob
Best regards,
David Eriksson,
http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but
my time is very
limited at
the moment, so I'll need three things, the
dll you're using on
the
device and the code you're using to call it,
and the command
code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to execute the test located
at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/which has a DLL with it.
Post by Mark Ellis
Post by David Richardson
Ah yes, I've never noticed that there !
If someone can briefly explain how I would go about
getting the
command code for CeRapiInvoke on WM5, I have the
necessary hardware
and time.
Theoretically, run a small program on a windows host
that just
RapiInit's and calls the command we're interested in,
and capture the
transmission on the network interface using eg.
wireshark.
Of course, being MS it's rarely that straightforward,
and if David is
correct it could be a lot more complex. However, if
you could use the
test prog for CeRapiInvoke from windows and capture
everything over the
interface, we might be fortunate.
I don't have anything set up to generate the
call
on Windows to capture that code, so someone
will have to find
it for me.
Mark
------------------------------------------------------------------------------
Post by Mark Ellis
Post by David Richardson
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
David Richardson
2009-06-29 21:02:00 UTC
Permalink
I implemented reading of the output_size and output_buffer too. I couldn't
figure out how to actually run the CeRapiInvoke tests (my automake
experience is lacking) but I did create a separate executable that does the
same thing as those tests. It should pass test_ping_result and
test_ping_buffer now, but not the stream test (will still return
E_NOTIMPL). I didn't check test_last_error yet.
Post by David Richardson
Post by Mark Ellis
Post by David Richardson
I called CeCreateFile("//test.txt", GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); and watched that
connection on wireshark so I had some basis for comparison.
CeCreateFile has a command code of 0x16 and using this knowledge I
believe the command code for CeRapiInvoke is 0x4C on WM5. (Which
according to
https://synce.svn.sourceforge.net/svnroot/synce/trunk/librapi2/src/rapi2/READMEis already taken by CeSetDatabaseInfoEx which is troubling, I think)
Post by Mark Ellis
Post by David Richardson
I've attached the log of CeCreateFile in case someone wants to double
check my work or like me finds it easier to compare the two
side-by-side.
My amateur opinion is that CeCreateFile and CeRapiInvoke look really
similar on the wire and is hopefully not hard to implement for that
reason. I'll try my hand at it today.
-David Richardson
On Fri, Jun 26, 2009 at 12:44 PM, David Richardson
I'm calling
hr = CeRapiInvoke("\\invokeme.dll", "PingBuffer",
PING_BUFFER_SIZE, buffer, &output_size, &output_buffer, NULL,
0);
with PING_BUFFER_SIZE = 10
David, the trace of the call sent to the device looks good. It actually
looks exactly like what rapi1 invoke would send apart from the command
code, which should make life easier.
I can't see the data being sent back however. The data returned from the
first call (packet 16) looks like this
0c 00 00 00 data len = 0x0c = 12
7e 00 00 00 error mod not found
7e 00 07 80
00 00 00 00
which would suggest it can't find the dll. Is the path correct in your
call ?
I noticed that as well. Check out this pcap file. I'm calling PingResult
this time and you can actually see the data being returned. PingResult takes
a value and returns it as a the return code. I'm passing in 0x12345678. I'm
trying to take it one step at a time and just trying to get the return code
and error code to be valid before I worry about reading the output_size and
output_buffer. I've got that working. You're right, its pretty much
exactly the same as the old invoke.
I'll implement the reading of output_size and buffer today and send a
patch. I'm not going to look into stream mode at this time, but may in the
future.
Thanks for all the help!
Post by Mark Ellis
As for code 0x4c being assigned to CeSetDatabaseInfoEx, none of the
database functions for rapi2 have been implemented. Maybe David (E) can
give some indication of how reliable that list is ?
Mark
Sometimes I wonder why I spend so much time writing software that deals
with MS rubbish :)
Can't invoke on WM5+ because it's in 'RAPI Restricted Mode', anyone know
how to switch to 'Open Mode' ?
I'm not encountering this problem. I'm guessing its because I disabled all
security in Visual Studio for the device.
Post by Mark Ellis
Post by David Richardson
I've attached the wireshark pcap. Ignore everything before 12
seconds. I called the identical invoke 3 times on the
device. buffer should be 10 0xDD's. output_buffer and
output_size were uninitialized and when finished output_buffer
is identical to buffer and output_size is 10
(PING_BUFFER_SIZE).
I'm not sending this to hand it off to you guys. I'm still
looking at this myself to see if I can implement it or figure
out the command code, but I'm sure the people on this list
have more experience doing this.
Let me know if you have any questions or want me to redo with
some changes.
-David Richardson
On Thu, Jun 25, 2009 at 3:44 AM, Mark Ellis
On Thu, 2009-06-25 at 00:39 +0200, David Richardson
On Wed, Jun 24, 2009 at 12:35 AM, Mark Ellis
On Mon, 2009-06-22 at 22:10 +0200, David
On Wed, 2009-06-17 at 18:07 -0700, Captain
Hey,
I have been trying to get CeRapiInvoke
to work. Just using
the unit
tests in the release. All I get is
-2147467263 as a return
result.
0x80004001 means "not implemented"
Is CeRapiInvoke implemented? Is it still
only Stream mode?
UTSL :-)
Unfortunately it has not been implemented
for Windows Mobile
5 or newer
devices. Any takers on the synce-devel
list?
Thanks for your time,
Rob
Best regards,
David Eriksson,
http://www.divideandconquer.se/
Rob, I'll take a look at this sometime, but
my time is very
limited at
the moment, so I'll need three things, the
dll you're using on
the
device and the code you're using to call it,
and the command
code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to execute the test located
at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/which has a DLL with it.
Post by Mark Ellis
Post by David Richardson
Ah yes, I've never noticed that there !
If someone can briefly explain how I would go about
getting the
command code for CeRapiInvoke on WM5, I have the
necessary hardware
and time.
Theoretically, run a small program on a windows host
that just
RapiInit's and calls the command we're interested in,
and capture the
transmission on the network interface using eg.
wireshark.
Of course, being MS it's rarely that straightforward,
and if David is
correct it could be a lot more complex. However, if
you could use the
test prog for CeRapiInvoke from windows and capture
everything over the
interface, we might be fortunate.
I don't have anything set up to generate the
call
on Windows to capture that code, so someone
will have to find
it for me.
Mark
------------------------------------------------------------------------------
Post by Mark Ellis
Post by David Richardson
_______________________________________________
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
Mark Ellis
2009-07-07 19:42:02 UTC
Permalink
Post by David Richardson
I implemented reading of the output_size and output_buffer too. I
couldn't figure out how to actually run the CeRapiInvoke tests (my
automake experience is lacking) but I did create a separate executable
that does the same thing as those tests. It should pass
test_ping_result and test_ping_buffer now, but not the stream test
(will still return E_NOTIMPL). I didn't check test_last_error yet.
Hi David, thanks for the patch. I'd like to do some work on the rest of
it, but I do linux programming, not MS :) I've got a trial version of
Visual Studio around somewhere, can you explain how to disable the
device's security from there ?

Ta
Mark
Post by David Richardson
On Mon, Jun 29, 2009 at 11:26 AM, David Richardson
On Mon, Jun 29, 2009 at 7:42 AM, Mark Ellis
On Fri, 2009-06-26 at 22:37 +0200, David Richardson
Post by David Richardson
I called CeCreateFile("//test.txt", GENERIC_READ |
GENERIC_WRITE, 0,
Post by David Richardson
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
and watched that
Post by David Richardson
connection on wireshark so I had some basis for
comparison.
Post by David Richardson
CeCreateFile has a command code of 0x16 and using
this knowledge I
Post by David Richardson
believe the command code for CeRapiInvoke is 0x4C
on WM5. (Which
Post by David Richardson
according to
https://synce.svn.sourceforge.net/svnroot/synce/trunk/librapi2/src/rapi2/README is already taken by CeSetDatabaseInfoEx which is troubling, I think)
Post by David Richardson
I've attached the log of CeCreateFile in case
someone wants to double
Post by David Richardson
check my work or like me finds it easier to
compare the two
Post by David Richardson
side-by-side.
My amateur opinion is that CeCreateFile and
CeRapiInvoke look really
Post by David Richardson
similar on the wire and is hopefully not hard to
implement for that
Post by David Richardson
reason. I'll try my hand at it today.
-David Richardson
On Fri, Jun 26, 2009 at 12:44 PM, David Richardson
I'm calling
hr = CeRapiInvoke("\\invokeme.dll",
"PingBuffer",
Post by David Richardson
PING_BUFFER_SIZE, buffer, &output_size,
&output_buffer, NULL,
Post by David Richardson
0);
with PING_BUFFER_SIZE = 10
David, the trace of the call sent to the device
looks good. It actually
looks exactly like what rapi1 invoke would send
apart from the command
code, which should make life easier.
I can't see the data being sent back however. The
data returned from the
first call (packet 16) looks like this
0c 00 00 00 data len = 0x0c = 12
7e 00 00 00 error mod not found
7e 00 07 80
00 00 00 00
which would suggest it can't find the dll. Is the
path correct in your
call ?
I noticed that as well. Check out this pcap file. I'm
calling PingResult this time and you can actually see the data
being returned. PingResult takes a value and returns it as a
the return code. I'm passing in 0x12345678. I'm trying to
take it one step at a time and just trying to get the return
code and error code to be valid before I worry about reading
the output_size and output_buffer. I've got that working.
You're right, its pretty much exactly the same as the old
invoke.
I'll implement the reading of output_size and buffer today and
send a patch. I'm not going to look into stream mode at this
time, but may in the future.
Thanks for all the help!
As for code 0x4c being assigned to
CeSetDatabaseInfoEx, none of the
database functions for rapi2 have been implemented.
Maybe David (E) can
give some indication of how reliable that list is ?
Mark
Sometimes I wonder why I spend so much time writing
software that deals
with MS rubbish :)
Can't invoke on WM5+ because it's in 'RAPI Restricted
Mode', anyone know
how to switch to 'Open Mode' ?
I'm not encountering this problem. I'm guessing its because I
disabled all security in Visual Studio for the device.
Post by David Richardson
I've attached the wireshark pcap. Ignore
everything before 12
Post by David Richardson
seconds. I called the identical invoke 3
times on the
Post by David Richardson
device. buffer should be 10 0xDD's.
output_buffer and
Post by David Richardson
output_size were uninitialized and when
finished output_buffer
Post by David Richardson
is identical to buffer and output_size is
10
Post by David Richardson
(PING_BUFFER_SIZE).
I'm not sending this to hand it off to you
guys. I'm still
Post by David Richardson
looking at this myself to see if I can
implement it or figure
Post by David Richardson
out the command code, but I'm sure the
people on this list
Post by David Richardson
have more experience doing this.
Let me know if you have any questions or
want me to redo with
Post by David Richardson
some changes.
-David Richardson
On Thu, Jun 25, 2009 at 3:44 AM, Mark
Ellis
Post by David Richardson
On Thu, 2009-06-25 at 00:39 +0200,
David Richardson
Post by David Richardson
On Wed, Jun 24, 2009 at 12:35
AM, Mark Ellis
Post by David Richardson
On Mon, 2009-06-22 at
22:10 +0200, David
Post by David Richardson
On Wed, 2009-06-17 at
18:07 -0700, Captain
Post by David Richardson
Hey,
I have been trying
to get CeRapiInvoke
Post by David Richardson
to work. Just using
the unit
tests in the
release. All I get is
Post by David Richardson
-2147467263 as a return
result.
0x80004001 means "not
implemented"
Post by David Richardson
Is CeRapiInvoke
implemented? Is it still
Post by David Richardson
only Stream mode?
UTSL :-)
Unfortunately it has
not been implemented
Post by David Richardson
for Windows Mobile
5 or newer
devices. Any takers on
the synce-devel
Post by David Richardson
list?
Thanks for your
time,
Post by David Richardson
Rob
Best regards,
David Eriksson,
http://www.divideandconquer.se/
Rob, I'll take a look at
this sometime, but
Post by David Richardson
my time is very
limited at
the moment, so I'll need
three things, the
Post by David Richardson
dll you're using on
the
device and the code
you're using to call it,
Post by David Richardson
and the command
code for
CeRapiInvoke on WM5 :)
I believe Rob was trying to
execute the test located
Post by David Richardson
at
http://synce.svn.sourceforge.net/viewvc/synce/trunk/librapi2/tests/CeRapiInvoke/ which has a DLL with it.
Post by David Richardson
Ah yes, I've never noticed that
there !
Post by David Richardson
If someone can briefly explain
how I would go about
Post by David Richardson
getting the
command code for CeRapiInvoke on
WM5, I have the
Post by David Richardson
necessary hardware
and time.
Theoretically, run a small program
on a windows host
Post by David Richardson
that just
RapiInit's and calls the command
we're interested in,
Post by David Richardson
and capture the
transmission on the network
interface using eg.
Post by David Richardson
wireshark.
Of course, being MS it's rarely
that straightforward,
Post by David Richardson
and if David is
correct it could be a lot more
complex. However, if
Post by David Richardson
you could use the
test prog for CeRapiInvoke from
windows and capture
Post by David Richardson
everything over the
interface, we might be fortunate.
I don't have anything
set up to generate the
Post by David Richardson
call
on Windows to capture
that code, so someone
Post by David Richardson
will have to find
it for me.
Mark
------------------------------------------------------------------------------
_______________________________________________
Post by David Richardson
SynCE-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/synce-devel
David Richardson
2009-07-07 19:53:38 UTC
Permalink
The first step is to get it detected by ActiveSync. If you're using a VM
like I am, you're unlikely to get RNDIS to connect, so disable advanced
networking. Once it is detected fire up VS and Tools > Device Security
Manager... > Connect to a device...

Platform: Windows Mobile 5.0 Pocket PC SDK
Devices: Windows Mobile 5.0 Pocket PC Device R2

Hit connect and be ready to hit "Yes" to about 5 dialog boxes on the
device. Afterwards click "Security Off" and then "Deploy to Device".

You probably need the WM SDK to do this (maybe included, depending on your
trial).

Installing SdkCerts.cab may do the trick, too. I'm also a Linux developer
and would love to cut the Visual Studio step out of my development.
Post by Mark Ellis
Post by David Richardson
I implemented reading of the output_size and output_buffer too. I
couldn't figure out how to actually run the CeRapiInvoke tests (my
automake experience is lacking) but I did create a separate executable
that does the same thing as those tests. It should pass
test_ping_result and test_ping_buffer now, but not the stream test
(will still return E_NOTIMPL). I didn't check test_last_error yet.
Hi David, thanks for the patch. I'd like to do some work on the rest of
it, but I do linux programming, not MS :) I've got a trial version of
Visual Studio around somewhere, can you explain how to disable the
device's security from there ?
Ta
Mark
David Richardson
2009-07-07 20:06:28 UTC
Permalink
Also this patch has a minor bug fix (wasn't actually responding with the
number of bytes in the output, but just synce_tracing the value).
Post by David Richardson
The first step is to get it detected by ActiveSync. If you're using a VM
like I am, you're unlikely to get RNDIS to connect, so disable advanced
networking. Once it is detected fire up VS and Tools > Device Security
Manager... > Connect to a device...
Platform: Windows Mobile 5.0 Pocket PC SDK
Devices: Windows Mobile 5.0 Pocket PC Device R2
Hit connect and be ready to hit "Yes" to about 5 dialog boxes on the
device. Afterwards click "Security Off" and then "Deploy to Device".
You probably need the WM SDK to do this (maybe included, depending on your
trial).
Installing SdkCerts.cab may do the trick, too. I'm also a Linux developer
and would love to cut the Visual Studio step out of my development.
Post by Mark Ellis
Post by David Richardson
I implemented reading of the output_size and output_buffer too. I
couldn't figure out how to actually run the CeRapiInvoke tests (my
automake experience is lacking) but I did create a separate executable
that does the same thing as those tests. It should pass
test_ping_result and test_ping_buffer now, but not the stream test
(will still return E_NOTIMPL). I didn't check test_last_error yet.
Hi David, thanks for the patch. I'd like to do some work on the rest of
it, but I do linux programming, not MS :) I've got a trial version of
Visual Studio around somewhere, can you explain how to disable the
device's security from there ?
Ta
Mark
Mark Ellis
2009-07-10 15:17:21 UTC
Permalink
Post by David Richardson
Also this patch has a minor bug fix (wasn't actually responding with
the number of bytes in the output, but just synce_tracing the value).
Cool, I've now managed to disable the security on my device to test
this, and have now committed your second patch with a couple of tweaks.
I couldn't decide from the documentation whether pcbOutput was allowed
to be NULL, but since one of the tests passes in NULL I've put in a
check for it. The tests all now pass except for using a stream
obviously.

I previously committed a patch to build the invoke test, so if you use
the source from svn you won't need your other test executable.

As for cutting out the Visual Studio step, it may well just be sending
some config xml to the device when we change security settings. If you
want to, capture the network traffic when you 'deploy to device', and if
it just looks like some xml you can try sending it with the rapiconfig
tool.

Mark
Post by David Richardson
On Tue, Jul 7, 2009 at 12:53 PM, David Richardson
The first step is to get it detected by ActiveSync. If you're
using a VM like I am, you're unlikely to get RNDIS to connect,
so disable advanced networking. Once it is detected fire up
VS and Tools > Device Security Manager... > Connect to a
device...
Platform: Windows Mobile 5.0 Pocket PC SDK
Devices: Windows Mobile 5.0 Pocket PC Device R2
Hit connect and be ready to hit "Yes" to about 5 dialog boxes
on the device. Afterwards click "Security Off" and then
"Deploy to Device".
You probably need the WM SDK to do this (maybe included,
depending on your trial).
Installing SdkCerts.cab may do the trick, too. I'm also a
Linux developer and would love to cut the Visual Studio step
out of my development.
On Tue, Jul 7, 2009 at 12:42 PM, Mark Ellis
Post by David Richardson
I implemented reading of the output_size and
output_buffer too. I
Post by David Richardson
couldn't figure out how to actually run the
CeRapiInvoke tests (my
Post by David Richardson
automake experience is lacking) but I did create a
separate executable
Post by David Richardson
that does the same thing as those tests. It should
pass
Post by David Richardson
test_ping_result and test_ping_buffer now, but not
the stream test
Post by David Richardson
(will still return E_NOTIMPL). I didn't check
test_last_error yet.
Hi David, thanks for the patch. I'd like to do some
work on the rest of
it, but I do linux programming, not MS :) I've got a
trial version of
Visual Studio around somewhere, can you explain how to
disable the
device's security from there ?
Ta
Mark
David Richardson
2009-07-13 18:29:38 UTC
Permalink
Thanks for letting me contribute!
Post by Mark Ellis
Post by David Richardson
Also this patch has a minor bug fix (wasn't actually responding with
the number of bytes in the output, but just synce_tracing the value).
Cool, I've now managed to disable the security on my device to test
this, and have now committed your second patch with a couple of tweaks.
I couldn't decide from the documentation whether pcbOutput was allowed
to be NULL, but since one of the tests passes in NULL I've put in a
check for it. The tests all now pass except for using a stream
obviously.
I previously committed a patch to build the invoke test, so if you use
the source from svn you won't need your other test executable.
As for cutting out the Visual Studio step, it may well just be sending
some config xml to the device when we change security settings. If you
want to, capture the network traffic when you 'deploy to device', and if
it just looks like some xml you can try sending it with the rapiconfig
tool.
You're exactly right. For other's ease of use I've attached the necessary
xml here. Note that you need SdkCerts.cab installed for rapiconfig to
succeed.
Post by Mark Ellis
Mark
Post by David Richardson
On Tue, Jul 7, 2009 at 12:53 PM, David Richardson
The first step is to get it detected by ActiveSync. If you're
using a VM like I am, you're unlikely to get RNDIS to connect,
so disable advanced networking. Once it is detected fire up
VS and Tools > Device Security Manager... > Connect to a
device...
Platform: Windows Mobile 5.0 Pocket PC SDK
Devices: Windows Mobile 5.0 Pocket PC Device R2
Hit connect and be ready to hit "Yes" to about 5 dialog boxes
on the device. Afterwards click "Security Off" and then
"Deploy to Device".
You probably need the WM SDK to do this (maybe included,
depending on your trial).
Installing SdkCerts.cab may do the trick, too. I'm also a
Linux developer and would love to cut the Visual Studio step
out of my development.
On Tue, Jul 7, 2009 at 12:42 PM, Mark Ellis
On Mon, 2009-06-29 at 23:02 +0200, David Richardson
Post by David Richardson
I implemented reading of the output_size and
output_buffer too. I
Post by David Richardson
couldn't figure out how to actually run the
CeRapiInvoke tests (my
Post by David Richardson
automake experience is lacking) but I did create a
separate executable
Post by David Richardson
that does the same thing as those tests. It should
pass
Post by David Richardson
test_ping_result and test_ping_buffer now, but not
the stream test
Post by David Richardson
(will still return E_NOTIMPL). I didn't check
test_last_error yet.
Hi David, thanks for the patch. I'd like to do some
work on the rest of
it, but I do linux programming, not MS :) I've got a
trial version of
Visual Studio around somewhere, can you explain how to
disable the
device's security from there ?
Ta
Mark
Loading...