Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a24842b4
Kaydet (Commit)
a24842b4
authored
Mar 16, 2011
tarafından
obo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
CWS-TOOLING: integrate CWS jl164
üst
8fd8b7a9
0775f9ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
module.cxx
sal/osl/w32/module.cxx
+23
-0
procimpl.cxx
sal/osl/w32/procimpl.cxx
+35
-0
No files found.
sal/osl/w32/module.cxx
100644 → 100755
Dosyayı görüntüle @
a24842b4
...
...
@@ -36,6 +36,7 @@
#include <osl/thread.h>
#include <osl/file.h>
#include <rtl/logfile.h>
#include <vector>
/*
under WIN32, we use the void* oslModule
...
...
@@ -65,10 +66,32 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 nRtldMod
rtl_uString_assign
(
&
Module
,
strModuleName
);
hInstance
=
LoadLibraryW
(
reinterpret_cast
<
LPCWSTR
>
(
Module
->
buffer
));
if
(
hInstance
==
NULL
)
hInstance
=
LoadLibraryExW
(
reinterpret_cast
<
LPCWSTR
>
(
Module
->
buffer
),
NULL
,
LOAD_WITH_ALTERED_SEARCH_PATH
);
//In case of long path names (\\?\c:\...) try to shorten the filename.
//LoadLibrary cannot handle file names which exceed 260 letters.
//In case the path is to long, the function will fail. However, the error
//code can be different. For example, it returned ERROR_FILENAME_EXCED_RANGE
//on Windows XP and ERROR_INSUFFICIENT_BUFFER on Windows 7 (64bit)
if
(
hInstance
==
NULL
&&
Module
->
length
>
260
)
{
std
::
vector
<
sal_Unicode
,
rtl
::
Allocator
<
sal_Unicode
>
>
vec
(
Module
->
length
+
1
);
DWORD
len
=
GetShortPathNameW
(
reinterpret_cast
<
LPCWSTR
>
(
Module
->
buffer
),
&
vec
[
0
],
Module
->
length
+
1
);
if
(
len
)
{
hInstance
=
LoadLibraryW
(
&
vec
[
0
]);
if
(
hInstance
==
NULL
)
hInstance
=
LoadLibraryExW
(
&
vec
[
0
],
NULL
,
LOAD_WITH_ALTERED_SEARCH_PATH
);
}
}
if
(
hInstance
<=
(
HINSTANCE
)
HINSTANCE_ERROR
)
hInstance
=
0
;
...
...
sal/osl/w32/procimpl.cxx
100644 → 100755
Dosyayı görüntüle @
a24842b4
...
...
@@ -300,6 +300,39 @@ namespace /* private */
return
quoted
.
makeStringAndClear
();
}
//The parameter path must be a system path. If it is longer than 260 characters
//then it is shortened using the GetShortPathName function. This function only
//works if the path exists. Because "path" can be the path to an executable, it
//may not have the file extension ".exe". However, if the file on disk has the
//".exe" extension, then the function will fail. In this case a second attempt
//is started by adding the parameter "extension" to "path".
rtl
::
OUString
getShortPath
(
rtl
::
OUString
const
&
path
,
rtl
::
OUString
const
&
extension
)
{
rtl
::
OUString
ret
(
path
);
if
(
path
.
getLength
()
>
260
)
{
std
::
vector
<
sal_Unicode
,
rtl
::
Allocator
<
sal_Unicode
>
>
vec
(
path
.
getLength
()
+
1
);
//GetShortPathNameW only works if the file can be found!
const
DWORD
len
=
GetShortPathNameW
(
path
.
getStr
(),
&
vec
[
0
],
path
.
getLength
()
+
1
);
if
(
!
len
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
&&
extension
.
getLength
())
{
const
rtl
::
OUString
extPath
(
path
+
extension
);
std
::
vector
<
sal_Unicode
,
rtl
::
Allocator
<
sal_Unicode
>
>
vec2
(
extPath
.
getLength
()
+
1
);
const
DWORD
len2
=
GetShortPathNameW
(
extPath
.
getStr
(),
&
vec2
[
0
],
extPath
.
getLength
()
+
1
);
ret
=
rtl
::
OUString
(
&
vec2
[
0
],
len2
);
}
else
{
ret
=
rtl
::
OUString
(
&
vec
[
0
],
len
);
}
}
return
ret
;
}
//##########################################################
// Returns the system path of the executable which can either
// be provided via the strImageName parameter or as first
...
...
@@ -326,6 +359,8 @@ namespace /* private */
if
(
osl_File_E_None
!=
osl
::
FileBase
::
getSystemPathFromFileURL
(
exe_url
,
exe_path
))
return
rtl
::
OUString
();
exe_path
=
getShortPath
(
exe_path
,
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
".exe"
)));
if
(
exe_path
.
indexOf
(
' '
)
!=
-
1
)
exe_path
=
quote_string
(
exe_path
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment