Skip to content

Commit

Permalink
mobve SILOOBJECT_BASIC_INFORMATION to winapi
Browse files Browse the repository at this point in the history
Signed-off-by: qmuntal <[email protected]>
  • Loading branch information
qmuntal committed Mar 5, 2024
1 parent f506624 commit 6428d3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
9 changes: 1 addition & 8 deletions internal/jobobject/jobobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,14 +525,7 @@ func isJobSilo(h windows.Handle) bool {
// 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
// if it's a silo or not. We still need to define the struct layout as expected by Win32, else the struct
// alignment might be different and the call will fail.
type SILOOBJECT_BASIC_INFORMATION struct {
SiloID uint32
SiloParentID uint32
NumberOfProcesses uint32
IsInServerSilo bool
Reserved [3]uint8
}
var siloInfo SILOOBJECT_BASIC_INFORMATION
var siloInfo winapi.SILOOBJECT_BASIC_INFORMATION
err := winapi.QueryInformationJobObject(
h,
winapi.JobObjectSiloBasicInformation,
Expand Down
15 changes: 15 additions & 0 deletions internal/winapi/jobobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ type JOBOBJECT_ASSOCIATE_COMPLETION_PORT struct {
CompletionPort windows.Handle
}

// typedef struct _SILOOBJECT_BASIC_INFORMATION {
// DWORD SiloId;
// DWORD SiloParentId;
// DWORD NumberOfProcesses;
// BOOLEAN IsInServerSilo;
// BYTE Reserved[3];
// } SILOOBJECT_BASIC_INFORMATION, *PSILOOBJECT_BASIC_INFORMATION;
type SILOOBJECT_BASIC_INFORMATION struct {
SiloID uint32
SiloParentID uint32
NumberOfProcesses uint32
IsInServerSilo bool
Reserved [3]uint8
}

// BOOL IsProcessInJob(
// HANDLE ProcessHandle,
// HANDLE JobHandle,
Expand Down

0 comments on commit 6428d3d

Please sign in to comment.