Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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ç
Batuhan Osman TASKAYA
cpython
Commits
33354476
Kaydet (Commit)
33354476
authored
Kas 21, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Check for PyUnicode_AS_UNICODE() failure
üst
53b33e76
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
7 deletions
+38
-7
cfield.c
Modules/_ctypes/cfield.c
+5
-2
_subprocess.c
PC/_subprocess.c
+13
-1
import_nt.c
PC/import_nt.c
+14
-3
dynload_win.c
Python/dynload_win.c
+6
-1
No files found.
Modules/_ctypes/cfield.c
Dosyayı görüntüle @
33354476
...
...
@@ -1472,12 +1472,15 @@ BSTR_set(void *ptr, PyObject *value, Py_ssize_t size)
/* create a BSTR from value */
if
(
value
)
{
Py_ssize_t
size
=
PyUnicode_GET_SIZE
(
value
);
wchar_t
*
wvalue
;
if
((
unsigned
)
size
!=
size
)
{
PyErr_SetString
(
PyExc_ValueError
,
"String too long for BSTR"
);
return
NULL
;
}
bstr
=
SysAllocStringLen
(
PyUnicode_AS_UNICODE
(
value
),
(
unsigned
)
size
);
wvalue
=
PyUnicode_AsUnicode
(
value
);
if
(
wvalue
==
NULL
)
return
NULL
;
bstr
=
SysAllocStringLen
(
wvalue
,
(
unsigned
)
size
);
Py_DECREF
(
value
);
}
else
bstr
=
NULL
;
...
...
PC/_subprocess.c
Dosyayı görüntüle @
33354476
...
...
@@ -417,6 +417,7 @@ sp_CreateProcess(PyObject* self, PyObject* args)
PROCESS_INFORMATION
pi
;
STARTUPINFOW
si
;
PyObject
*
environment
;
wchar_t
*
wenvironment
;
Py_UNICODE
*
application_name
;
Py_UNICODE
*
command_line
;
...
...
@@ -461,6 +462,17 @@ sp_CreateProcess(PyObject* self, PyObject* args)
return
NULL
;
}
if
(
environment
)
{
wenvironment
=
PyUnicode_AsUnicode
(
environment
)
if
(
wenvironment
==
NULL
)
{
Py_XDECREF
(
environment
);
return
NULL
;
}
}
else
wenvironment
=
NULL
;
Py_BEGIN_ALLOW_THREADS
result
=
CreateProcessW
(
application_name
,
command_line
,
...
...
@@ -468,7 +480,7 @@ sp_CreateProcess(PyObject* self, PyObject* args)
NULL
,
inherit_handles
,
creation_flags
|
CREATE_UNICODE_ENVIRONMENT
,
environment
?
PyUnicode_AS_UNICODE
(
environment
)
:
NULL
,
wenvironment
,
current_directory
,
&
si
,
&
pi
);
...
...
PC/import_nt.c
Dosyayı görüntüle @
33354476
...
...
@@ -35,6 +35,7 @@ _PyWin_FindRegisteredModule(PyObject *moduleName,
wchar_t
pathBuf
[
MAXPATHLEN
+
1
];
int
pathLen
=
MAXPATHLEN
+
1
;
PyObject
*
path
,
*
moduleKey
,
*
suffix
;
wchar_t
*
wmoduleKey
,
*
wsuffix
;
struct
filedescr
*
fdp
;
HKEY
keyBase
;
int
modNameSize
;
...
...
@@ -52,17 +53,22 @@ _PyWin_FindRegisteredModule(PyObject *moduleName,
PyWin_DLLVersionString
,
moduleName
);
if
(
moduleKey
==
NULL
)
return
NULL
;
wmoduleKey
=
PyUnicode_AsUnicode
(
moduleKey
);
if
(
wmoduleKey
==
NULL
)
{
Py_DECREF
(
moduleKey
);
return
NULL
;
}
keyBase
=
HKEY_CURRENT_USER
;
modNameSize
=
pathLen
;
regStat
=
RegQueryValueW
(
keyBase
,
PyUnicode_AS_UNICODE
(
moduleKey
)
,
regStat
=
RegQueryValueW
(
keyBase
,
wmoduleKey
,
pathBuf
,
&
modNameSize
);
if
(
regStat
!=
ERROR_SUCCESS
)
{
/* No user setting - lookup in machine settings */
keyBase
=
HKEY_LOCAL_MACHINE
;
/* be anal - failure may have reset size param */
modNameSize
=
pathLen
;
regStat
=
RegQueryValueW
(
keyBase
,
PyUnicode_AS_UNICODE
(
moduleKey
)
,
regStat
=
RegQueryValueW
(
keyBase
,
wmoduleKey
,
pathBuf
,
&
modNameSize
);
if
(
regStat
!=
ERROR_SUCCESS
)
{
Py_DECREF
(
moduleKey
);
...
...
@@ -80,10 +86,15 @@ _PyWin_FindRegisteredModule(PyObject *moduleName,
suffix
=
PyUnicode_FromString
(
fdp
->
suffix
);
if
(
suffix
==
NULL
)
return
NULL
;
wsuffix
=
PyUnicode_AsUnicode
(
suffix
);
if
(
wsuffix
==
NULL
)
{
Py_DECREF
(
suffix
);
return
NULL
;
}
extLen
=
PyUnicode_GET_SIZE
(
suffix
);
if
((
Py_ssize_t
)
modNameSize
>
extLen
&&
_wcsnicmp
(
pathBuf
+
((
Py_ssize_t
)
modNameSize
-
extLen
-
1
),
PyUnicode_AS_UNICODE
(
suffix
)
,
wsuffix
,
extLen
)
==
0
)
{
Py_DECREF
(
suffix
);
...
...
Python/dynload_win.c
Dosyayı görüntüle @
33354476
...
...
@@ -176,11 +176,16 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname,
{
dl_funcptr
p
;
char
funcname
[
258
],
*
import_python
;
wchar_t
*
wpathname
;
#ifndef _DEBUG
_Py_CheckPython3
();
#endif
wpathname
=
PyUnicode_AsUnicode
(
pathname
);
if
(
wpathname
==
NULL
)
return
NULL
;
PyOS_snprintf
(
funcname
,
sizeof
(
funcname
),
"PyInit_%.200s"
,
shortname
);
{
...
...
@@ -195,7 +200,7 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname,
/* We use LoadLibraryEx so Windows looks for dependent DLLs
in directory of pathname first. */
/* XXX This call doesn't exist in Windows CE */
hDLL
=
LoadLibraryExW
(
PyUnicode_AS_UNICODE
(
pathname
)
,
NULL
,
hDLL
=
LoadLibraryExW
(
wpathname
,
NULL
,
LOAD_WITH_ALTERED_SEARCH_PATH
);
_Py_DeactivateActCtx
(
cookie
);
...
...
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