IsProcessPackaged determines if the process is packaged by trying to resolve the package identifier.
(proc windows.Handle)
| 108 | // IsProcessPackaged determines if the process is packaged by trying |
| 109 | // to resolve the package identifier. |
| 110 | func IsProcessPackaged(proc windows.Handle) (bool, error) { |
| 111 | var n uint32 |
| 112 | err := GetPackageID(proc, &n, 0) |
| 113 | if err == windows.ERROR_INSUFFICIENT_BUFFER { |
| 114 | b := make([]byte, n) |
| 115 | err = GetPackageID(proc, &n, uintptr(unsafe.Pointer(&b[0]))) |
| 116 | } |
| 117 | return err == nil, err |
| 118 | } |
| 119 | |
| 120 | // IsWindowsService reports whether the process is currently executing |
| 121 | // as a Windows service. |