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

Chris Parsons chris at courtsmart.com
Thu Sep 6 07:18:02 PDT 2001



>	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];
// 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.



More information about the Vorbis-dev mailing list