Opened 19 years ago

Last modified 19 years ago

#866 closed enhancement (fixed)

new driver search rules for WIN32 platform

Reported by: dzibarev@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: minor Keywords:
Cc:

Description

It would be nice if both OGRSFDriverRegistrar::AutoLoadDrivers() and
GDALDriverManager::AutoLoadDrivers() searches for modules in current directory
when no GDAL_DRIVER_PATH or OGR_DRIVER_PATH environment variables are set.

Attachments (4)

gdaldrivermanager2.diff (612 bytes ) - added by dzibarev@… 19 years ago.
Proposed solution for GDALDrivermanager
ogrsfdriverregistrar2.diff (662 bytes ) - added by dzibarev@… 19 years ago.
Proposed solution for OGRSFDriverRegistrar
autoloaders-patch.diff (3.3 KB ) - added by dzibarev@… 19 years ago.
Proposed solution
autoloaders.diff (3.1 KB ) - added by dzibarev@… 19 years ago.
Another patch.

Download all attachments as: .zip

Change History (8)

by dzibarev@…, 19 years ago

Attachment: gdaldrivermanager2.diff added

Proposed solution for GDALDrivermanager

by dzibarev@…, 19 years ago

Attachment: ogrsfdriverregistrar2.diff added

Proposed solution for OGRSFDriverRegistrar

comment:1 by warmerdam, 19 years ago

Denis, 

Thanks for the suggestion, but I'm not really comfortable with doing this. 
I am concerned about accidentally trying to load DLLs/shared libraries with 
names prefixed with "gdal_*" as well as getting different results depending
on what directory is the current working directory.

But thanks for the feedback!

Best regards,

comment:2 by dzibarev@…, 19 years ago

Another solution - look into executable module directory when searching for modules

by dzibarev@…, 19 years ago

Attachment: autoloaders-patch.diff added

Proposed solution

comment:3 by warmerdam, 19 years ago

Well, this retains the fundamental problem of likely collections with DLLs
not intended to be plugins.  I would be willing to accept that this
seems somewhat
unlikely except that another use (Maciek) has already complained to me quite
severely about using insufficiently specific plugin directories, and because it
happens that my own FWTools distribution puts "gdal_fw.dll" in the
same directory
as the GDAL executables, even though this is not a plugin.

What about if GDAL looked in a gdalplugins directory under the
directory containing
the executables as a fallback?  So anyone wanting to provide GDAL plugin
drivers on win32 could just drop them in such a subdirectory under the directory
where the .exe files are?


by dzibarev@…, 19 years ago

Attachment: autoloaders.diff added

Another patch.

comment:4 by warmerdam, 19 years ago

I have applied a variation on this patch which accomplishes the same effect
in CVS.  The main difference is puting the GetModuleFilename() call into 
gdal/port so I can avoid pulling windows.h into mainly GDAL modules. 

I did a brief test on windows and it seems to work properly.

Thanks!

Note: See TracTickets for help on using tickets.