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
80ac11d0
Kaydet (Commit)
80ac11d0
authored
May 24, 2016
tarafından
Steve Dower
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #23026: winreg.QueryValueEx() now return an integer for REG_QWORD type. (Patch by hakril)
üst
b0f80b03
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
3 deletions
+50
-3
winreg.rst
Doc/library/winreg.rst
+9
-1
3.6.rst
Doc/whatsnew/3.6.rst
+8
-0
test_winreg.py
Lib/test/test_winreg.py
+1
-0
NEWS
Misc/NEWS
+2
-0
winreg.c
PC/winreg.c
+30
-2
No files found.
Doc/library/winreg.rst
Dosyayı görüntüle @
80ac11d0
...
...
@@ -633,7 +633,7 @@ For more information, see `Registry Value Types
.. data:: REG_DWORD_LITTLE_ENDIAN
A 32-bit number in little-endian format.
A 32-bit number in little-endian format.
Equivalent to :const:`REG_DWORD`.
.. data:: REG_DWORD_BIG_ENDIAN
...
...
@@ -657,6 +657,14 @@ For more information, see `Registry Value Types
No defined value type.
.. data:: REG_QWORD
A 64-bit number.
.. data:: REG_QWORD_LITTLE_ENDIAN
A 64-bit number in little-endian format. Equivalent to :const:`REG_QWORD`.
.. data:: REG_RESOURCE_LIST
A device-driver resource list.
...
...
Doc/whatsnew/3.6.rst
Dosyayı görüntüle @
80ac11d0
...
...
@@ -421,6 +421,14 @@ The "Object allocated at" traceback is new and only displayed if
:mod:`warnings` was already imported.
winreg
------
The :func:`QueryValueEx <winreg.QueryValueEx>` function now returns
integer values for registry type ``REG_QWORD``.
(Contributed by Clement Rouault in :issue:`23026`.)
zipfile
-------
...
...
Lib/test/test_winreg.py
Dosyayı görüntüle @
80ac11d0
...
...
@@ -37,6 +37,7 @@ test_reflect_key_name = "SOFTWARE\\Classes\\" + test_key_base
test_data
=
[
(
"Int Value"
,
45
,
REG_DWORD
),
(
"Qword Value"
,
0x1122334455667788
,
REG_QWORD
),
(
"String Val"
,
"A string value"
,
REG_SZ
),
(
"StringExpand"
,
"The path is
%
path
%
"
,
REG_EXPAND_SZ
),
(
"Multi-string"
,
[
"Lots"
,
"of"
,
"string"
,
"values"
],
REG_MULTI_SZ
),
...
...
Misc/NEWS
Dosyayı görüntüle @
80ac11d0
...
...
@@ -19,6 +19,8 @@ Core and Builtins
Library
-------
- Issue #23026: winreg.QueryValueEx() now return an integer for REG_QWORD type.
- Issue #26741: subprocess.Popen destructor now emits a ResourceWarning warning
if the child process is still running.
...
...
PC/winreg.c
Dosyayı görüntüle @
80ac11d0
...
...
@@ -563,6 +563,24 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
memcpy
(
*
retDataBuf
,
&
d
,
sizeof
(
DWORD
));
}
break
;
case
REG_QWORD
:
if
(
value
!=
Py_None
&&
!
PyLong_Check
(
value
))
return
FALSE
;
*
retDataBuf
=
(
BYTE
*
)
PyMem_NEW
(
DWORD64
,
1
);
if
(
*
retDataBuf
==
NULL
){
PyErr_NoMemory
();
return
FALSE
;
}
*
retDataSize
=
sizeof
(
DWORD64
);
if
(
value
==
Py_None
)
{
DWORD64
zero
=
0
;
memcpy
(
*
retDataBuf
,
&
zero
,
sizeof
(
DWORD64
));
}
else
{
DWORD64
d
=
PyLong_AsUnsignedLongLong
(
value
);
memcpy
(
*
retDataBuf
,
&
d
,
sizeof
(
DWORD64
));
}
break
;
case
REG_SZ
:
case
REG_EXPAND_SZ
:
{
...
...
@@ -690,7 +708,13 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
if
(
retDataSize
==
0
)
obData
=
PyLong_FromUnsignedLong
(
0
);
else
obData
=
PyLong_FromUnsignedLong
(
*
(
int
*
)
retDataBuf
);
obData
=
PyLong_FromUnsignedLong
(
*
(
DWORD
*
)
retDataBuf
);
break
;
case
REG_QWORD
:
if
(
retDataSize
==
0
)
obData
=
PyLong_FromUnsignedLongLong
(
0
);
else
obData
=
PyLong_FromUnsignedLongLong
(
*
(
DWORD64
*
)
retDataBuf
);
break
;
case
REG_SZ
:
case
REG_EXPAND_SZ
:
...
...
@@ -1599,7 +1623,7 @@ winreg.SetValueEx
An integer that specifies the type of the data, one of:
REG_BINARY -- Binary data in any form.
REG_DWORD -- A 32-bit number.
REG_DWORD_LITTLE_ENDIAN -- A 32-bit number in little-endian format.
REG_DWORD_LITTLE_ENDIAN -- A 32-bit number in little-endian format.
Equivalent to REG_DWORD
REG_DWORD_BIG_ENDIAN -- A 32-bit number in big-endian format.
REG_EXPAND_SZ -- A null-terminated string that contains unexpanded
references to environment variables (for example,
...
...
@@ -1609,6 +1633,8 @@ winreg.SetValueEx
by two null characters. Note that Python handles
this termination automatically.
REG_NONE -- No defined value type.
REG_QWORD -- A 64-bit number.
REG_QWORD_LITTLE_ENDIAN -- A 64-bit number in little-endian format. Equivalent to REG_QWORD.
REG_RESOURCE_LIST -- A device-driver resource list.
REG_SZ -- A null-terminated string.
value: object
...
...
@@ -1918,6 +1944,8 @@ PyMODINIT_FUNC PyInit_winreg(void)
ADD_INT
(
REG_DWORD
);
ADD_INT
(
REG_DWORD_LITTLE_ENDIAN
);
ADD_INT
(
REG_DWORD_BIG_ENDIAN
);
ADD_INT
(
REG_QWORD
);
ADD_INT
(
REG_QWORD_LITTLE_ENDIAN
);
ADD_INT
(
REG_LINK
);
ADD_INT
(
REG_MULTI_SZ
);
ADD_INT
(
REG_RESOURCE_LIST
);
...
...
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