Update deps; this fixes something related to Windows registry

This commit is contained in:
Frank Denis 2018-02-27 09:51:05 +01:00
parent 0dfd4b70fc
commit 66d93da954
3 changed files with 7 additions and 9 deletions

4
Gopkg.lock generated
View File

@ -130,7 +130,7 @@
"poly1305",
"salsa20/salsa"
]
revision = "432090b8f568c018896cd8a0fb0345872bbac6ce"
revision = "beaf6a35706e5032ae4c3fcf342c663c069f44d2"
[[projects]]
branch = "master"
@ -154,7 +154,7 @@
"windows/svc/eventlog",
"windows/svc/mgr"
]
revision = "37707fdb30a5b38865cfb95e5aab41707daec7fd"
revision = "f6cff0780e542efa0c8e864dc8fa522808f6a598"
[solve-meta]
analyzer-name = "dep"

View File

@ -113,12 +113,10 @@ func OpenRemoteKey(pcname string, k Key) (Key, error) {
// The parameter n controls the number of returned names,
// analogous to the way os.File.Readdirnames works.
func (k Key) ReadSubKeyNames(n int) ([]string, error) {
ki, err := k.Stat()
if err != nil {
return nil, err
}
names := make([]string, 0, ki.SubKeyCount)
buf := make([]uint16, ki.MaxSubKeyLen+1) // extra room for terminating zero byte
names := make([]string, 0)
// Registry key size limit is 255 bytes and described there:
// https://msdn.microsoft.com/library/windows/desktop/ms724872.aspx
buf := make([]uint16, 256) //plus extra room for terminating zero byte
loopItems:
for i := uint32(0); ; i++ {
if n > 0 {

View File

@ -29,7 +29,7 @@ func randKeyName(prefix string) string {
}
func TestReadSubKeyNames(t *testing.T) {
k, err := registry.OpenKey(registry.CLASSES_ROOT, "TypeLib", registry.ENUMERATE_SUB_KEYS|registry.QUERY_VALUE)
k, err := registry.OpenKey(registry.CLASSES_ROOT, "TypeLib", registry.ENUMERATE_SUB_KEYS)
if err != nil {
t.Fatal(err)
}