Skip to content

Commit 6428d3d

Browse files
committed
mobve SILOOBJECT_BASIC_INFORMATION to winapi
Signed-off-by: qmuntal <[email protected]>
1 parent f506624 commit 6428d3d

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

internal/jobobject/jobobject.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -525,14 +525,7 @@ func isJobSilo(h windows.Handle) bool {
525525
// the call will fail if the job hasn't been upgraded to a silo so we can use this to tell when we open a job
526526
// if it's a silo or not. We still need to define the struct layout as expected by Win32, else the struct
527527
// alignment might be different and the call will fail.
528-
type SILOOBJECT_BASIC_INFORMATION struct {
529-
SiloID uint32
530-
SiloParentID uint32
531-
NumberOfProcesses uint32
532-
IsInServerSilo bool
533-
Reserved [3]uint8
534-
}
535-
var siloInfo SILOOBJECT_BASIC_INFORMATION
528+
var siloInfo winapi.SILOOBJECT_BASIC_INFORMATION
536529
err := winapi.QueryInformationJobObject(
537530
h,
538531
winapi.JobObjectSiloBasicInformation,

internal/winapi/jobobject.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,21 @@ type JOBOBJECT_ASSOCIATE_COMPLETION_PORT struct {
160160
CompletionPort windows.Handle
161161
}
162162

163+
// typedef struct _SILOOBJECT_BASIC_INFORMATION {
164+
// DWORD SiloId;
165+
// DWORD SiloParentId;
166+
// DWORD NumberOfProcesses;
167+
// BOOLEAN IsInServerSilo;
168+
// BYTE Reserved[3];
169+
// } SILOOBJECT_BASIC_INFORMATION, *PSILOOBJECT_BASIC_INFORMATION;
170+
type SILOOBJECT_BASIC_INFORMATION struct {
171+
SiloID uint32
172+
SiloParentID uint32
173+
NumberOfProcesses uint32
174+
IsInServerSilo bool
175+
Reserved [3]uint8
176+
}
177+
163178
// BOOL IsProcessInJob(
164179
// HANDLE ProcessHandle,
165180
// HANDLE JobHandle,

0 commit comments

Comments
 (0)