Problem with DMProcessConfigXML

G

Guest

Guest
Archived from groups: microsoft.public.pocketpc (More info?)

Hello!

I have a strange problem using DMProcessConfigXML.

I want DMProcessConfigXML to process some XML files sequentially. Therefor I
store in a ascii file the names of the XML files, line per line:

File1.xml
File2.xml

Then I read one XML file from the list, convert it to Unicode and process it
by DMProcessConfigXML.

The strange thing is, when it comes to the second file, I get an error
0x80042009!
There should be nothing wrong with the XML code, because when File1 and
File2 are identically the same, File1 gets processed ok, but File2 failes.

Both XML files look like:

<?xml version="1.0" ?>

<wap-provisioningdoc>

<characteristic type="BrowserFavorite">

<characteristic type="Northwind Traders">

<parm name="URL"

value="http://www.northwindtraders.com"/>

</characteristic>

</characteristic>

</wap-provisioningdoc>



Might there be any timeing problem? Do I have to wait for the first
transaction to complete until I can call DMProcessConfigXML again? What type
of error does the hex-value mean?

I have also tried to process different CSPs sequentially (CM_GPRSENTRIES,
CM_PPPEntries,...), each one in a single XML file. I found out, that when
processing them sequentially, some XML fail, but depending on the order of
processing.

Any help would be appreciated!

Regards

Peter
 
G

Guest

Guest
Archived from groups: microsoft.public.pocketpc (More info?)

OK - problem identified and fixed:

This is part of my code:

if ((fh = _wfopen(strFile,L"r")) != NULL) {
fseek(fh,0L,SEEK_END);
fgetpos(fh,(fpos_t*)&lDW);
fseek(fh,0L,SEEK_SET);
bBinary = (char*)malloc(lDW);
if (bBinary != NULL) {
memset(bBinary,'\0',lDW); // <------------ this is the fix of the
problem
fread(bBinary,1,lDW,fh);
wBuffer = (wchar_t*)malloc(sizeof(wchar_t)*lDW);
mbstowcs(wBuffer,bBinary,lDW);

Although you request allocation of 1 byte, malloc will allocate 8 byte, so
the difference of the requested bytecount and ((bytecount/8)+1)*8 is not
initialized with 0.

Maybe this helps others facing the same problem!

Regards
Peter
"Peter Gun" <petergun@hotmail.com> wrote in message
news:clda8b$oe2$05$1@news.t-online.com...
> Hello!
>
> I have a strange problem using DMProcessConfigXML.
>
> I want DMProcessConfigXML to process some XML files sequentially. Therefor
I
> store in a ascii file the names of the XML files, line per line:
>
> File1.xml
> File2.xml
>
> Then I read one XML file from the list, convert it to Unicode and process
it
> by DMProcessConfigXML.
>
> The strange thing is, when it comes to the second file, I get an error
> 0x80042009!
> There should be nothing wrong with the XML code, because when File1 and
> File2 are identically the same, File1 gets processed ok, but File2 failes.
>
> Both XML files look like:
>
> <?xml version="1.0" ?>
>
> <wap-provisioningdoc>
>
> <characteristic type="BrowserFavorite">
>
> <characteristic type="Northwind Traders">
>
> <parm name="URL"
>
> value="http://www.northwindtraders.com"/>
>
> </characteristic>
>
> </characteristic>
>
> </wap-provisioningdoc>
>
>
>
> Might there be any timeing problem? Do I have to wait for the first
> transaction to complete until I can call DMProcessConfigXML again? What
type
> of error does the hex-value mean?
>
> I have also tried to process different CSPs sequentially (CM_GPRSENTRIES,
> CM_PPPEntries,...), each one in a single XML file. I found out, that when
> processing them sequentially, some XML fail, but depending on the order of
> processing.
>
> Any help would be appreciated!
>
> Regards
>
> Peter
>
>
>
>
>
>
>
>
>
 

ASK THE COMMUNITY