[vorbis-dev] Problems trying to run the examples in windows v orbis sdk

Chris Wolf cwolf at starclass.com
Thu Sep 6 14:45:20 PDT 2001



Ok, I added file mapped shared memory and copied the backend mapping function pointers from vorbis.dll into it.
I was able to successfully see vorbisenc.dll invoke a function from a pointer in shared memory,
pointing into vorbis.dll.

The question is this.  If DLL 'A' initializes the shared memory upon which DLL 'B' is dependent,
what insurance is there that A gets loaded before B? (and thus A's DllMain getting called before B's DllMain)
It just so happens, that in my case, vobis.dll gets loaded before vorbisenc.dll.  I'd like to avoid explicit loading.
(I guess I could have B load then unload A, if I really had to...)

Oh, and BTW, we don't need inter-process access here -- the same process loads the two DLL's.

        -Chris

*********** REPLY SEPARATOR  ***********

On 9/6/2001 at 10:18 AM Chris Parsons wrote:

>>	Isn't it true that if you bracket global definitions with
>>	#pragma data_seg(".some_name")
>>	...
>>	#pragma data_seg()
>>
>>	...that those globals become sharable a' la 3.x DLL's?  In any case,
>I tried it and it didn't help.
>>
>>	From the debugger, I can access the address of _time_P, which is a
>global
>>	inside vorbis.dll (I also have it exported in the module definition
>file)  I can even access the first element
>>	of this pointer array, but when a try to dereference one of the
>function pointers, it blows up. 
>>
>>	Here's what I tried  (vorbisenc.c):
>>
>>	  /* time backend settings */
>>	  for(i=0;i<ci->times;i++)
>>	  {
>>		  int vit = ci->time_type[i];
>>		  vorbis_func_time *data = _time_P[vit];
>// this succeeds
>>
>>	 //    void *(*copy_info)(vorbis_info_time *) = _time_P[vit]->copy_info;
>// access violation
>>	 //    void *(*copy_info)(vorbis_info_time *) = data->copy_info;
>// access violation
>>	//     void *(*copy_info)(vorbis_info_time *) = time0_copy_info;
>// this succeeds
>>	//     void *(*copy_info)(vorbis_info_time *) =
>time0_exportbundle.copy_info; // this succeeds
>>
>>		  ci->time_param[i] = copy_info(cs->time_param[i]);
>>		/*
>>		ci->time_param[i]=_time_P[ci->time_type[i]]->
>>		  copy_info(cs->time_param[i]);
>>		  */
>>	  }
>
>In Windows #pragma data_seg(".some_name") does indeed name the segment but
>it no longer makes it globally accessable as in 3.x.  In 3.x you could also
>create static data segments that would achieve the same purpose, but no
>longer.  In Windows there no longer is any compiler method that will let
>you
>share memory between processes as it is now illegal for a process to access
>memory outside of it's data segments.  Attempting to do so will cause an
>access violation.  Obviously this is a kick in the teeth for cross platform
>compatibility as the only way that memory can be shared is in a
>non-standard
>programmatical method.
>
>--- >8 ----
>List archives:  http://www.xiph.org/archives/
>Ogg project homepage: http://www.xiph.org/ogg/
>To unsubscribe from this list, send a message to
>'vorbis-dev-request at xiph.org'
>containing only the word 'unsubscribe' in the body.  No subject is needed.
>Unsubscribe messages sent to the list will be ignored/filtered.

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list